Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sending large Data over WCF Pin
PavanPT9-Dec-07 17:01
PavanPT9-Dec-07 17:01 
QuestionHow to set Expiry Date to .ppt/.pptx files [modified] Pin
sachinkalse9-Dec-07 14:34
sachinkalse9-Dec-07 14:34 
GeneralRe: How to set Expiry Date to .ppt/.pptx files Pin
Paul Conrad15-Dec-07 9:06
professionalPaul Conrad15-Dec-07 9:06 
QuestionWhere does the webbrowser keep images? Pin
aj.esler9-Dec-07 12:53
aj.esler9-Dec-07 12:53 
GeneralRe: Where does the webbrowser keep images? Pin
Christian Graus9-Dec-07 13:19
protectorChristian Graus9-Dec-07 13:19 
GeneralRe: Where does the webbrowser keep images? Pin
aj.esler9-Dec-07 13:47
aj.esler9-Dec-07 13:47 
GeneralRe: Where does the webbrowser keep images? Pin
Christian Graus9-Dec-07 13:49
protectorChristian Graus9-Dec-07 13:49 
AnswerRe: Where does the webbrowser keep images? Pin
aj.esler10-Dec-07 0:30
aj.esler10-Dec-07 0:30 
I think i have found a way to do it. Had a look at the code i would need to use to access the cache and it looked way too nasty.
So i constructed a simple function which searches recursively through all the directories in the cache, including the hidden ones, looking for files with the same name as the image i just downloaded in the webbrowser. It then takes the one with the most recent creation date and gives me the full path to it.
A simple and inelegant hack, but it works =).

Posted below if it can help anyone.

<br />
private void SearchCache(string filename) <br />
        {<br />
            string filetype = filename.Substring(filename.LastIndexOf('.')+1).ToLower();<br />
            filename = filename.Substring(0, (filename.LastIndexOf('.')));<br />
            <br />
            DateTime nowDT = DateTime.Now;<br />
            DateTime latestFileDT = new DateTime();<br />
            string filePath = "";<br />
<br />
            string cachePath = @"C:\Documents and Settings\[UserName]\Temporary Internet Files\Content.IE5";<br />
<br />
            DirectoryInfo cacheDir = new DirectoryInfo(cachePath);<br />
<br />
            string regexPattern = "^"+filename+@"\[?(\d+)*\]?."+filetype+"$";<br />
            Regex r = new Regex(regexPattern, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);<br />
<br />
            foreach (DirectoryInfo d in cacheDir.GetDirectories())<br />
            {<br />
                foreach(FileInfo f in d.GetFiles())<br />
                {<br />
                    if (r.IsMatch(f.Name))<br />
                    {<br />
                        if (f.CreationTime > latestFileDT)<br />
                        {<br />
                            latestFileDT = f.CreationTime;<br />
                            filePath = f.FullName;<br />
                        }<br />
                    }<br />
                }<br />
            }<br />
        }<br />

QuestionDatabase learning basics Pin
kingletas9-Dec-07 12:15
kingletas9-Dec-07 12:15 
GeneralRe: Database learning basics Pin
Christian Graus9-Dec-07 13:14
protectorChristian Graus9-Dec-07 13:14 
GeneralLocating objects that throw the NullReferenceException in Deployed Applications [modified] Pin
Brett Blatchley9-Dec-07 11:36
Brett Blatchley9-Dec-07 11:36 
GeneralRe: Locating objects that throw the NullReferenceException in Deployed Applications Pin
Christian Graus9-Dec-07 13:25
protectorChristian Graus9-Dec-07 13:25 
GeneralRe: Locating objects that throw the NullReferenceException in Deployed Applications Pin
Brett Blatchley9-Dec-07 17:58
Brett Blatchley9-Dec-07 17:58 
GeneralRe: Locating objects that throw the NullReferenceException in Deployed Applications Pin
mav.northwind10-Dec-07 2:22
mav.northwind10-Dec-07 2:22 
QuestionReusing a method that takes class as argument Pin
karthikde19809-Dec-07 11:27
karthikde19809-Dec-07 11:27 
GeneralRe: Reusing a method that takes class as argument Pin
Christian Graus9-Dec-07 13:16
protectorChristian Graus9-Dec-07 13:16 
GeneralRe: Reusing a method that takes class as argument Pin
Anthony Mushrow9-Dec-07 15:46
professionalAnthony Mushrow9-Dec-07 15:46 
GeneralRe: Reusing a method that takes class as argument Pin
Christian Graus9-Dec-07 16:23
protectorChristian Graus9-Dec-07 16:23 
Generalsize of a structure Pin
daavena9-Dec-07 8:22
daavena9-Dec-07 8:22 
GeneralRe: size of a structure Pin
Paul Conrad9-Dec-07 12:41
professionalPaul Conrad9-Dec-07 12:41 
GeneralRe: size of a structure Pin
Colin Angus Mackay9-Dec-07 14:36
Colin Angus Mackay9-Dec-07 14:36 
QuestionWPF hardware acceleration Pin
Bartosz Bien9-Dec-07 7:26
Bartosz Bien9-Dec-07 7:26 
GeneralRe: WPF hardware acceleration Pin
Christian Graus9-Dec-07 9:32
protectorChristian Graus9-Dec-07 9:32 
GeneralRe: WPF hardware acceleration Pin
CKnig9-Dec-07 18:37
CKnig9-Dec-07 18:37 
GeneralRe: WPF hardware acceleration Pin
Paul Conrad9-Dec-07 12:43
professionalPaul Conrad9-Dec-07 12:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.