Since the DirectoryInfo.GetFiles method accepts an overload with a
string matching the file pattern you want to seach for, and also a
boolean indicating whether to search subdirectories or not, I believe
you need to modify your GetFiles line.

Also, note that the Cookies are (also) stored in C:\Documents and
Settings\<user.name>\Cookies.

On Oct 15, 12:13 am, "toanmh\\" <[EMAIL PROTECTED]> wrote:
> I'm using WebBrowser control. I want to automatic clearn cookies when
> close webpage. Please help me.
> I have use code to clearn cache in IE but not delete any things :
>    private static void EmptyCacheFolder(DirectoryInfo folder)
>     {
>
>         //Get the list file in temporary
>         FileInfo[] files = folder.GetFiles();
>         foreach (FileInfo file in files)
>         {
>             try
>             {
>                 System.IO.File.Delete(file.FullName);
>             }
>             catch (System.Exception e)
>             {
>
>             }
>
>         }
>
>         //Find in subfolder
>         DirectoryInfo[] directoryInfos = folder.GetDirectories();
>         foreach (DirectoryInfo directoryInfo in directoryInfos)
>         {
>             EmptyCacheFolder(directoryInfo);
>         }
>
>     }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment

You may subscribe to group Feeds using a RSS Feed Reader to stay upto date 
using following url  

<a href="http://feeds.feedburner.com/DotNetDevelopment";> 
http://feeds.feedburner.com/DotNetDevelopment</a>
-~----------~----~----~----~------~----~------~--~---

Reply via email to