Solved

Delete specific files in a directory

Posted on 1998-02-19
99
300 Views
Last Modified: 2010-04-10
This question is kinda complex any help (example code manly) will really help me!  

1.) First off, does anyone know how I can get the directory that Netscape saves it's cache too??  Is there a reg key??  I know that the defualt is <install dir>\Netscape\user\cache (I think that is it) but what happens if someone changes it??  I know about the reg key that tells me the user's name so that wouldn't be to hard to work with, but if the user changes it then my application can not view the cache.

2.) If the above is posible, how can I load that key into my Borland C++ Builder v1.0 application and delete all of the following files...
*.htm
*.html
*.shtml
*.pl
*.cgi
*.tmp

How do i do that???  PLEASE HELP!!!!!
0
Comment
Question by:stevenc317
  • 49
  • 42
  • 4
  • +2
99 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1182552
1) Use REGEDIT to search the registry for that path name on your machine (assume you have netscape installed) and find the name of the key for yourself.

2) You can make a loop using FindFirstFile/FindNextFile with the appropriate wildcard spec (build from the folder path name from the reg and the wilcard spec above, then DeleteFile for each file found in turn
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182553
tried the first one, couldn't find it THAT IS WHY I ASKED!!!

second, do not know how THAT IS WHY I ASKED!!
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1182554
1) If it isn't in the registry, then I suggest that it isn't in the registry.

2) something like this should work...

WIN32_FIND_DATA FindFileData;
HANDLE handle = ::FindFirstFile("<whatever>\*.htm",&FindFileData);
if (handle != INVALID_HANDLE_VALUE) {
  do {
    ::DeleteFile(FindFileData.cFileName);
  } while (::FindNextFile(handle,&FindFileData);
}

0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182555
Stevenc317

The key should be found at
My Computer\HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\Cache\


0
 

Expert Comment

by:4099aol
ID: 1182556
RONSLOW the reg key is in  q2quo's comment, how can I get it in the find file thing u made??
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1182557
I'm not familiar with BOrlands string library .. but you should be able to read the key in with the registry functions, then append each of your wildcard filespecs in turn to that string and do a loop like the one above.

I cannot go into details at the moment, I need to go to the hospital to visit my partner who is suffering from gall stones :-(

I should be able to give you more info later.

Sorry I cannot be of more help right now.

0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182558
Well I hope your partner gets better soon.  I will reopen the question (to allow a Builder programmer to answer)

thanks!!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182559
sorry aol4099 is another one of my logins...  so that was me asking the question...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182560
Aol4099

To read from a registry, you do the following

AnsiString s("\\HKEY_CURRENT_USER\\Software\\Netscape\\Netscape Navigator\\Cache");
AnsiString keyname("Cache Dir");
TRegistry myreg;

myreg.OpenKey(s, false);
AnsiString cachepath = ReadString(keyname);

Now, the path of your netscape cache direction will
be store in 'cachepath'


0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182561
any headers that need to be used?? also is this correct??

WIN32_FIND_DATA FindFileData;
HANDLE handle = ::FindFirstFile("cachepath\*.htm",&FindFileData);
if (handle != INVALID_HANDLE_VALUE) {
do {
::DeleteFile(FindFileData.cFileName);
} while (::FindNextFile(handle,&FindFileData);
}
 
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182562
Where did you get above code?
Does DeleteFile work?
I think, below is what it should be

TSearchRec f;
AnsiString ex("\*.htm");
FindFirst(cachepath+ex, faAnyFile, &f);

remove(f.Name);
while(!FindNext(&f)) {
      remove(f.Name);
}

0
 
LVL 3

Accepted Solution

by:
q2guo earned 70 total points
ID: 1182563
I don't think header files are needed.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1182564
The 'above code' is Win32 api code to loop through matching files and remove.

DeleteFile should certainly work - it is native windows rather than c runtime.

Your alternative is probably also correct, but apparently uses Borland wrappers for win32 functions (FindFirst,FindNext etc).

0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182565
Don't you my code looks a lot cleaner?
Also, since Stevenc317 is using Borland builder, why not
take advantage of it.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182566
Sorry, I meant to say
"Don't you think my code looks a lot cleaner?"
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182567
quguo....
So this is the correct code??

AnsiString s("\\HKEY_CURRENT_USER\\Software\\Netscape\\Netscape Navigator\\Cache");
AnsiString keyname("Cache Dir");
TRegistry myreg;
myreg.OpenKey(s, false);
AnsiString cachepath = ReadString(keyname);
TSearchRec f;
AnsiString ex("\*.htm");
FindFirst(cachepath+ex, faAnyFile, &f);
remove(f.Name);
while(!FindNext(&f)) {
remove(f.Name);
}
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182568
Just a few changes

AnsiString s("\\HKEY_CURRENT_USER\\Software\\Netscape\\Netscape Navigator\\Cache");
AnsiString keyname("Cache Dir");
TRegistry myreg;
myreg.OpenKey(s, false);
AnsiString cachepath = myreg.ReadString(keyname);
TSearchRec f;
AnsiString ex("\\*.htm");

FindFirst(cachepath+ex, faAnyFile, &f);
remove(f.Name);
while(!FindNext(&f)) {
        remove(f.Name);
}
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182569
[C++ Error] Unit1.cpp(30): Unidefined symbol 'TRegistry'.

[C++ Error] Unit1.cpp(30): Statement missing ;.

[C++ Error] Unit1.cpp(31): Unidefined symbol 'myreg'.

[C++ Error] Unit1.cpp(35): Cannot initialize 'Sysutils::TSearchRec &' with 'Sysutils::TSearchRec*.'

[C++ Error] Unit1.cpp(35): Type mismatch in parameter 'F' in call to '_fastcall Sysutils::FindFirst(const System::AnsiString,int,Sysutils::TSearchRec&)'.

[C++ Error] Unit1.cpp(36): Cannot convert 'Sytem::AnsiString'to 'const char*'.

[C++ Error] Unit1.cpp(36): Type mismatch in parameter '__path' in call to 'remove(const char*)'.

There are about 20 more messages......  So please check the codes.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182570
Can you go into your include direction in Borland Builder
and tell what files you have got there?
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182571
Ok, stevenc317
you need
#include <vcl/registry.hpp>
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182572
still have a ton of errors...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182573
What kind of errors?
Same as the errors before?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182574
yeah same messages, but by adding the header we took care of about 5-7 messages...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182575
Is this line still there?

[C++ Error] Unit1.cpp(30): Unidefined symbol 'TRegistry'.

If not, please post the errors.
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182576
[C++ Error] Unit1.cpp(31):VCL style classes must be constructed using operator new.

[C++ Error] Unit1.cpp(37): Cannont initialize 'Sysutils::TSearchRec &' with 'Sysutils::TSearchRec *.'

[C++ Error] Unit1.cpp(37): Type mismatch in parameter 'F' in call to '_fastcall Sysutils::FindFirst(const System::AnsiString,int,Sysutils::TSearchRec&)'.

[C++ Error] Unit1.cpp(38): Cannot convert 'System::AnsiString' to 'const char *'.

[C++ Error] Unit1.cpp(38): Type mismatch in parameter '__path' in call to 'remove(const char *).'

[C++ Error] Unit1.cpp(39): Cannot initialize 'Sysutils::TSearchRec &' with 'Sysutils::TSearchRec*.'

[C++ Error] Unit1.cpp(39): Type mismatch in parameter 'F' in call to '_fastcall Sysutils::FindNext(Sysutils::TSearchRec &)'.

[C++ Error] Unit1.cpp(40): Cannot convert 'System::AnisString' to 'const char *.'

[C++ Error] Unit1.cpp(40): Type mismatch in parameter '__path' in call to 'remove(const char*)'.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182577
ok, that's good, stevenc317 we are very close now
try this

AnsiString s("\\HKEY_CURRENT_USER\\Software\\Netscape\\Netscape Navigator\\Cache");
AnsiString keyname("Cache Dir");
TRegistry *myreg = new TRegistry;
myreg->OpenKey(s, false);
AnsiString cachepath = myreg->ReadString(keyname);
TSearchRec *f = new TSearchRec;
AnsiString ex("\\*.htm");

FindFirst(cachepath+ex, faAnyFile, f);

remove((f->Name).c_str());
while(!FindNext(f)) {
        remove((f->Name).c_str());
}
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182578
[C++ Error]Unit1.cpp(37): Cannot initialize 'Sysutils::TSearchRec &' with 'Sysutils::TSearchRec *'.

[C++ Error]Unit1.cpp(37): Type mismatch in parameter 'F' in call to '_fastcall Sysutils::FindFirst(cons System::AnsiString,int,Sysutils::TSearchRec &)'.

[C++ Error]Unit1.cpp(40): Cannot initialize 'Sysutils::TSearchRec &' with 'Sysutils::TSearchRec *'.

[C++ Error]Unit1.cpp(40): Type mismatch in parameter 'F' in call to '_fastcall Sysutils::FindNext(Sysutils::TSearchRec &)'.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182579
...

FindFirst(cachepath+ex, faAnyFile, *f);

remove((f->Name).c_str());

while(!FindNext(*f)) {
         remove((f->Name).c_str());
}
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182580
no error messages, but did not delete the files (*.htm).
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182581
I think that the reason why my program did not delte the .htm files is that the reg key (that u used) is not in my reg edit.  Whoever sent that tip in, please check your reg again.

thanks
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182582
Can you use you regedit and manually check to see if
the cache directory is stored in:
By the way, what netscape are you using?
My Computer\HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\Cache\
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182583
4099aol

The key could also be in
\\HKEY_USERS\\.default\\Software\\Netscape\\Netscape Navigator\\Cache
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182584
I do not have that key in my reg!  I have Netscape Communicator v4.04 for Win 95
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182585
also I have looked at my reg and can not find the path.  please keep looking I am going to ask Netscape...
0
 

Expert Comment

by:larockd
ID: 1182586
Now that the confusion has gone on to long...  I think it is time to explain what is going on...

1.)  Netscape and where does the cache go...  Ok, Netscape assumes if the user has not changed the cache directory manually that the cache dir is called "cache" and it is off the users root dir for netscape.  If the user changes his cache directory, then the new information is stored in the file PREFS.JS under the users dir Example E:\NETSCAPE\USERS\Q2QO\PREFS.JS

The line in the file that holds the info is like this
user_pref("browser.cache.directory", "G:\\TEMP");

You can get a lot of other information out of this file also..  You can use the registry to find out who are valid users, and then go to there directory and read the file to see if the user has changed his cache dir, otherwise you cache...

2.)  Q2 -> also you commented above about how clean your code is..  The code made available above from RONSLOW was solid WIN32 API code that will work on any compiler without any problems..

Steven,
   Hope the information above is helpful...  Your should have no problems from here, Q2 should steer you in the right direction from here...

D.
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182587
thanks, but how do I get that (info u said in question 1) into my C++ codes??
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182588
Wait I know what I will do, I will ahve a settings section in my program where the user can type in their directories (that hold the cache) I will save those directories to a reg key, then use the codes to delete the files!  Let me look into that, then I will grade you.

thanks
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182589
I made a reg key...

Directory1

and updated the codes to point to that key, the value of the key is windows\temp. int. files (I just wantted to type it fast, but the key has the full name).  And it doesn't work, so I am thinking that is your codes or that windows directory will not allow programs to delete cache form it...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182590
Which part of it is not working??
Write the registry part, reading the registry part?
I know it 's not the delete part.'

To prove to you it 's not the delete part
try this

SearchRec *f = new TSearchRec;

// put your cache direction path here                    
AnsiString ex("YOU CACHE DIR PATH HERE\\*.htm");

FindFirst(ex, faAnyFile, *f);
remove((f->Name).c_str());

while(!FindNext(*f)) {
     remove((f->Name).c_str());
}
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182591
it must be the read the reg part...

0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182592
Can you write to the registry ok?
Try use your program to write to the registry, and check the
result using regedit.exe
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182593
I made the reg key and checked to see if it was there, and it is..


0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182594
How did you make the key???
If you can make a key, then why isn't you other question
titled "Save Edit1 to a reg key??" working?
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182595
Can you post the part of your code that does
the reading and writing of the registry here?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182596
I made the key manualy (from with in regedit.exe).  To open the keu and del the files I am using the codes I have recived from you...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182597
Can you tell me where exactly have you added the key and
the code you use for reading it?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182598
HKEY_CURRENT_USER\Software\High Voltage\cache can\Directory1


Also I had a computer crash and lost the project.  Do you have C++ Builder?  If so can you just make the C++ file (that will delete .htm, .html (rest r above) and email it to me??  I will give u the 71 points and you name, url, and a quick advert for one of your programs.

PLEASE!!!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182599
wait, I found a backup and think I found the bug.

brb
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182600
Nope still not deleting it.  Here are the codes that I am using....

void __fastcall TForm1::EmptyCan1Click(TObject *Sender)
{
//Delete all .htm files from Directory 1
//AnsiString s("\\HKEY_CURRENT_USER\\Software\\Netscape\\Netscape Navigator\\Cache");

AnsiString s("\\HKEY_CURRENT_USER\\Software\\High Voltage\\cache can\\");

AnsiString keyname("Directory1");
TRegistry *myreg = new TRegistry;
myreg->OpenKey(s, false);
AnsiString cachepath = myreg->ReadString(keyname);
TSearchRec *f = new TSearchRec;
AnsiString ex("\\*.htm");

FindFirst(cachepath+ex, faAnyFile, *f);
remove((f->Name).c_str());
while(!FindNext(*f)) {
remove((f->Name).c_str());
}

//--- ALL FILES HAVE NOW BEEN DELETED - HOPEFULLY :-)!!

//Cache has been deleted dialog
Application->MessageBox("You cache has deleted!", "Cache Can", MB_OK);
}
//----------------------------------------------------------


0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Expert Comment

by:q2guo
ID: 1182601
I still can't tell how and where you added in the key manually.
Is it possible for you to open up your regedit, go to
the the key you have just added.  And capture the screen
and attach it to me at q2data@yahoo.com

My main problem is, I don't have Borland Builder.  So, I have
to guess at the mistakes.  You wouldn'y be going through all this
if I had Borland builder.
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182602
mailed it..
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182603
replace this line
AnsiString s("\\HKEY_CURRENT_USER\\Software\\High Voltage\\cache can\\");

with

AnsiString s("Software\\High Voltage\\cache can\\");

also can you insert
Application->MessageBox(cachepath+ex, "Cache Can", MB_OK);

after this line

AnsiString ex("\\*.htm");

to see what path we are actually getting?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182604
the message box doesn't work..
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182605
try this
Application->MessageBox(cachepath.c_str(), "Cache Can", MB_OK);
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182606
ok the dialog comes up and it is blank (only has an ok button).  So it is not reading the reg key!!!!!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182607
Do you think you will be able to fix it?? Also what programming language do u use???
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182608
try this


AnsiString s("\\HKEY_CURRENT_USER\\Software\\High Voltage\\cache can");
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182609
I use borland C 3.1 and Visual C++
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182610
still blank...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182611
try this


AnsiString s("\\Software\\High Voltage\\cache can");
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182612
ok it is showing the correct path, but is not deleting the files...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182613
What exactly is it showing?
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182614
c:\windows\Temporary Internet Files

I was using that as a test.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182615
A few things to check

Is the message box showing
c:\windows\Temporary Internet Files\
or
c:\windows\Temporary Internet Files
This is important

Make sure your have file with the .htm extension
in this temp directory

Also add
Application->MessageBox((f->Name).c_str(), "Cache Can", MB_OK);
after line
FindFirst(cachepath+ex, faAnyFile, *f);
and see what the messagebox says
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182616
c:\windows\Temporary Internet Files\

and yes there are .htm files in that directory...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182617
so, it 's
c:\windows\Temporary Internet Files\
ok then the line
AnsiString ex("\\*.htm");
should be just
AnsiString ex("*.htm");

That's it!!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182618
Ok
Application->MessageBox((f->Name).c_str(), "Cache Can", MB_OK);

Is producing a blank dialog box (only has an ok button).
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182619
hi did you try my previous comment
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182620
which comment (they are about 100).  I am sure I did, thou since I have done them all.


0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182621
This one
       
       
                     AnsiString ex("\\*.htm");
                     should be just
                     AnsiString ex("*.htm");


0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182622
do u think u can find the bug????
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182623
let me try that. sorry... jsut forget about the last comment!!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182624
nope still blank
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182625
Can you post your code here again, so I can check it.
Everything should be working fine.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182626
Did you add
Application->MessageBox((f->Name).c_str(), "Cache Can", MB_OK);
after line
AnsiString ex("*.htm");
or before?

Can also check again to see if *.htm files are still in
c:\windows\Temporary Internet Files\
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182627
after.

and yip there are still .htm files (and I checked they r .htm not .html) in that directory.
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182628
also here are the codes that I am using (just in case I skipped something).

//Delete all .htm files from Directory 1
//AnsiString s("\\HKEY_CURRENT_USER\\Software\\High Voltage\\cache can\\");
AnsiString s("\\Software\\High Voltage\\cache can");
AnsiString keyname("Directory1");
TRegistry *myreg = new TRegistry;
myreg->OpenKey(s, false);
AnsiString cachepath = myreg->ReadString(keyname);
TSearchRec *f = new TSearchRec;
AnsiString ex("*.htm");
//    Application->MessageBox(cachepath.c_str(), "Cache Can", MB_OK);

FindFirst(cachepath+ex, faAnyFile, *f);
Application->MessageBox((f->Name).c_str(), "Cache Can", MB_OK);
remove((f->Name).c_str());
while(!FindNext(*f)) {
remove((f->Name).c_str());


0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182629
...

AnsiString cachepath = myreg->ReadString(keyname);
TSearchRec sr;
AnsiString ex("*.htm");
// Application->MessageBox(cachepath.c_str(), "Cache Can", MB_OK);
AnsiString Cachefile = cachepath+ex;

// tell me what this message box prints out
Application->MessageBox(Cachefile.c_str(), "Cache Can", MB_OK);
FindFirst(Cachefile, faAnyFile, sr);
Application->MessageBox((sr.Name).c_str(), "Cache Can", MB_OK);
remove((sr.Name).c_str());

while(!FindNext(sr)) {
  remove((sr.Name).c_str());
}

FindClose(sr);

0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182630
the box u asked about was blank
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182631
Two tings to change

add
#include <vcl/dstring.h>

change this line
AnsiString Cachefile = cachepath+ex;
to
AnsiString Cachefile = cachepath.c_str() + ex;

Tell what that message box prints now
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182632
still blank...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182633
Can you tell me what each of the message box prints
you have three message boxes

0
 

Expert Comment

by:4099aol
ID: 1182634
In order....

c:\windows\Temorary Internet Files\*.htm

blank

Your cache ahs now been deleted.

0
 

Expert Comment

by:4099aol
ID: 1182635
oops.
Your cache has now been deleted.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182636
****, I know what 's wrong now!!!!

When you added in your key manually, you spelled
the directory name wrong
It 's
c:\windows\Temporary Internet Files\
not
c:\windows\Temorary Internet Files\

TRY AGAIN
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182637
nope, I checked.  I just spelled it wrong in my comment.

spelled right in regedit...

:-(
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182638
replace
FindFirst(Cachefile, faAnyFile, sr);
with
FindFirst(Cachefile, faReadOnly, sr);

And if it still does not work
Can you try using directory in the registry
C:\windows\temp\
instead of
C:\windows\temporary Internet Files\
just to see what happens
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182639
Ok.  I changed the code, still had the blank dialog box.  But when i changed c:\windows\Temporary Internet Files\ to c:\windows\temp\ it said netscape.htm and deleted it.  So I think for some reason is that, your code does not like logn file names!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182640
wait, nope it did not delete it.  But it did file the file!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182641
Sorry I mean it did find the file but did not delete it...
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182642

change all lines

remove((sr.Name).c_str());  

to

::DeleteFile(sr.Name);
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182643
have a lot of error messages..
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182644
ok, change it back
I will look for something else.

0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182645
ok
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182646
Can you log on to IRC?  So, We can chat live.
I HAVE TO get your program to work, both of us
have spent too much time.
If you can, please log on to EFNET, channel BB1Q
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182647
I do not have IRC, I have ICQ.
0
 
LVL 3

Expert Comment

by:q2guo
ID: 1182648
icq 's good
my icq number is 933472
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182649
Ok I have just added you to my contact list, please login!
0
 
LVL 1

Author Comment

by:stevenc317
ID: 1182650
thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now