Can anyone tell me the best way to rename the following "absolute pathway" as a "relative path"?
The pathway is:
C:\\Documents and Settings\\JohnSmith\\Cookies\\JohnSmith@mywebsite. txt
I am using File.Delete to delete the "JohnSmith@mywebsite.txt" cookie-file. This command works successfully providing I use the "absolute pathway" mentioned above ... BUT I need to rename it as "relative" pathway so the file will still get deleted, regardless of which computer my app is used on, and regardless of the drive on which Windows is installed, etc ...
I was thinking of something like:
"%systemdrive%\\Documents and Settings\\%userName%\\Cookies\\*@mywebsite.txt"
Is this the best way to do it? Or is there a more "foolproof" way to do it? Please, any suggestions welcome!

Reply With Quote

