Solved

Download and Save files to Temporary Internet Files folder

Posted on 2008-06-11
8
1,788 Views
Last Modified: 2013-11-23
Hi Delphi Experts,
I have made a delphi tool bar for IE using Delphi Band project code. I want to display some news scrolling in a label. Scrolling part I could complete. Now my question is:
The News comes from RSS feed. I have to extract all titles and pass them to the Label Caption property.
I want to know how to download the rss feed and save to Temporary Internet Files folder on client machine (who placed my tool bar). Temporary Internet Files folder location cannot be hard coded as C:\........\......\....... etc. Can some one help me please.
Regards
0
Comment
Question by:SHAHEEN_AKHTAR
  • 4
  • 2
  • 2
8 Comments
 
LVL 14

Accepted Solution

by:
SteveBay earned 250 total points
ID: 21759997
Here is function that I use to return all sorts of special folders:
function GetSpecialFolder(aKind : TSpecialFolderKind): String;

var

  pidl :pItemIDList;

  Buffer: array[0.. 260]of char;

  Malloc: IMalloc;

begin

     case akind of

     sfk_ALTSTARTUP              :     SHGetSpecialFolderLocation(0,CSIDL_ALTSTARTUP, pidl);

     sfk_APPDATA                 :     SHGetSpecialFolderLocation(0,CSIDL_APPDATA, pidl);

     sfk_BITBUCKET               :     SHGetSpecialFolderLocation(0,CSIDL_BITBUCKET, pidl);

     sfk_COMMON_ALTSTARTUP       :     SHGetSpecialFolderLocation(0,CSIDL_COMMON_ALTSTARTUP, pidl);

     sfk_COMMON_DESKTOPDIRECTORY :     SHGetSpecialFolderLocation(0,CSIDL_COMMON_DESKTOPDIRECTORY, pidl);

     sfk_COMMON_FAVORITES        :     SHGetSpecialFolderLocation(0,CSIDL_COMMON_FAVORITES, pidl);

     sfk_COMMON_PROGRAMS         :     SHGetSpecialFolderLocation(0,CSIDL_COMMON_PROGRAMS, pidl);

     sfk_COMMON_STARTMENU        :     SHGetSpecialFolderLocation(0,CSIDL_COMMON_STARTMENU, pidl);

     sfk_COMMON_STARTUP          :     SHGetSpecialFolderLocation(0,CSIDL_COMMON_STARTUP, pidl);

     sfk_CONTROLS                :     SHGetSpecialFolderLocation(0,CSIDL_CONTROLS, pidl);

     sfk_COOKIES                 :     SHGetSpecialFolderLocation(0,CSIDL_COOKIES, pidl);

     sfk_DESKTOP                 :     SHGetSpecialFolderLocation(0,CSIDL_DESKTOP, pidl);

     sfk_DESKTOPDIRECTORY        :     SHGetSpecialFolderLocation(0,CSIDL_DESKTOPDIRECTORY, pidl);

     sfk_DRIVES                  :     SHGetSpecialFolderLocation(0,CSIDL_DRIVES, pidl);

     sfk_FAVORITES               :     SHGetSpecialFolderLocation(0,CSIDL_FAVORITES, pidl);

     sfk_FONTS                   :     SHGetSpecialFolderLocation(0,CSIDL_FONTS, pidl);

     sfk_HISTORY                 :     SHGetSpecialFolderLocation(0,CSIDL_HISTORY, pidl);

     sfk_INTERNET                :     SHGetSpecialFolderLocation(0,CSIDL_INTERNET, pidl);

     sfk_INTERNET_CACHE          :     SHGetSpecialFolderLocation(0,CSIDL_INTERNET_CACHE, pidl);

     sfk_NETHOOD                 :     SHGetSpecialFolderLocation(0,CSIDL_NETHOOD, pidl);

     sfk_NETWORK                 :     SHGetSpecialFolderLocation(0,CSIDL_NETWORK, pidl);

     sfk_PERSONAL                :     SHGetSpecialFolderLocation(0,CSIDL_PERSONAL, pidl);

     sfk_PRINTERS                :     SHGetSpecialFolderLocation(0,CSIDL_PRINTERS, pidl);

     sfk_PRINTHOOD               :     SHGetSpecialFolderLocation(0,CSIDL_PRINTHOOD, pidl);

     sfk_PROGRAMS                :     SHGetSpecialFolderLocation(0,CSIDL_PROGRAMS, pidl);

     sfk_RECENT                  :     SHGetSpecialFolderLocation(0,CSIDL_RECENT, pidl);

     sfk_SENDTO                  :     SHGetSpecialFolderLocation(0,CSIDL_SENDTO, pidl);

     sfk_STARTMENU               :     SHGetSpecialFolderLocation(0,CSIDL_STARTMENU, pidl);

     sfk_STARTUP                 :     SHGetSpecialFolderLocation(0,CSIDL_STARTUP, pidl);

     sfk_TEMPLATES               :     SHGetSpecialFolderLocation(0,CSIDL_TEMPLATES, pidl);

     end;

     ShGetPathFromIdList(pidl, PChar(@Buffer));

     Result:= Buffer;

     OLECheck(SHGetMalloc(Malloc));

     if pidl <> nil then Malloc.Free(pidl);

end;
 

function GetPDFVersion: integer;

var Reg : TRegistry;

begin

     result := 0;

     Reg := TRegistry.Create;

     Reg.RootKey := HKEY_CLASSES_ROOT;

     if Reg.KeyExists('\CLSID\{CA8A9780-280D-11CF-A24D-444553540000}') then

          begin

          if Reg.OpenKeyReadOnly('\CLSID\{CA8A9780-280D-11CF-A24D-444553540000}\TypeLib') then

               begin

               result := 4;

               if Reg.ReadString('') = '{05BFD3F1-6319-4F30-B752-C7A22889BCC4}' then

                    result := 7;

               end;

          end;

     Reg.Free;

end;

Open in new window

0
 
LVL 26

Assisted Solution

by:Russell Libby
Russell Libby earned 250 total points
ID: 21760394
Another alternative, from my source. Either way, your looking for the CSIDL constant of CSIDL_INTERNET_CACHE

eg, using my source

  ShowMessage(GetFolderPath(CSIDL_INTERNET_CACHE));

----

Regards,
Russell


unit Folders;
////////////////////////////////////////////////////////////////////////////////
//
//   Unit           :  Folders
//   Author         :  rllibby
//   Date           :  05.16.2006
//   Description    :  Dynamic bound wrapper for the SHGetFolderPath function
//                     out of SHFolder and a fallback to the older Shell32
//                     library.
//
////////////////////////////////////////////////////////////////////////////////
interface

////////////////////////////////////////////////////////////////////////////////
//   Include units
////////////////////////////////////////////////////////////////////////////////
uses
  Windows, SysUtils, Classes, ComObj, ActiveX, ShlObj;

////////////////////////////////////////////////////////////////////////////////
//   Flags for SHGetFolderPath
////////////////////////////////////////////////////////////////////////////////
const
  SHGFP_TYPE_CURRENT            =  $0000;
  SHGFP_TYPE_DEFAULT            =  $0001;

////////////////////////////////////////////////////////////////////////////////
//   CSIDL constants
////////////////////////////////////////////////////////////////////////////////
const
  CSIDL_DESKTOP                 =  $0000;
  CSIDL_INTERNET                =  $0001;
  CSIDL_PROGRAMS                =  $0002;
  CSIDL_CONTROLS                =  $0003;
  CSIDL_PRINTERS                =  $0004;
  CSIDL_PERSONAL                =  $0005;
  CSIDL_FAVORITES               =  $0006;
  CSIDL_STARTUP                 =  $0007;
  CSIDL_RECENT                  =  $0008;
  CSIDL_SENDTO                  =  $0009;
  CSIDL_BITBUCKET               =  $000A;
  CSIDL_STARTMENU               =  $000B;
  CSIDL_MYDOCUMENTS             =  $000C;
  CSIDL_MYMUSIC                 =  $000D;
  CSIDL_MYVIDEO                 =  $000E;
  CSIDL_DESKTOPDIRECTORY        =  $0010;
  CSIDL_DRIVES                  =  $0011;
  CSIDL_NETWORK                 =  $0012;
  CSIDL_NETHOOD                 =  $0013;
  CSIDL_FONTS                   =  $0014;
  CSIDL_TEMPLATES               =  $0015;
  CSIDL_COMMON_STARTMENU        =  $0016;
  CSIDL_COMMON_PROGRAMS         =  $0017;
  CSIDL_COMMON_STARTUP          =  $0018;
  CSIDL_COMMON_DESKTOPDIRECTORY =  $0019;
  CSIDL_APPDATA                 =  $001A;
  CSIDL_PRINTHOOD               =  $001B;
  CSIDL_LOCAL_APPDATA           =  $001C;
  CSIDL_ALTSTARTUP              =  $001D;
  CSIDL_COMMON_ALTSTARTUP       =  $001E;
  CSIDL_COMMON_FAVORITES        =  $001F;
  CSIDL_INTERNET_CACHE          =  $0020;
  CSIDL_COOKIES                 =  $0021;
  CSIDL_HISTORY                 =  $0022;
  CSIDL_COMMON_APPDATA          =  $0023;
  CSIDL_WINDOWS                 =  $0024;
  CSIDL_SYSTEM                  =  $0025;
  CSIDL_PROGRAM_FILES           =  $0026;
  CSIDL_MYPICTURES              =  $0027;
  CSIDL_PROFILE                 =  $0028;
  CSIDL_SYSTEMX86               =  $0029;
  CSIDL_PROGRAM_FILESX86        =  $002A;
  CSIDL_PROGRAM_FILES_COMMON    =  $002B;
  CSIDL_PROGRAM_FILES_COMMONX86 =  $002C;
  CSIDL_COMMON_TEMPLATES        =  $002D;
  CSIDL_COMMON_DOCUMENTS        =  $002E;
  CSIDL_COMMON_ADMINTOOLS       =  $002F;
  CSIDL_ADMINTOOLS              =  $0030;
  CSIDL_CONNECTIONS             =  $0031;
  CSIDL_COMMON_MUSIC            =  $0035;
  CSIDL_COMMON_PICTURES         =  $0036;
  CSIDL_COMMON_VIDEO            =  $0037;
  CSIDL_RESOURCES               =  $0038;
  CSIDL_RESOURCES_LOCALIZED     =  $0039;
  CSIDL_COMMON_OEM_LINKS        =  $003A;
  CSIDL_CDBURN_AREA             =  $003B;
  CSIDL_COMPUTERSNEARME         =  $003D;
  CSIDL_FLAG_PER_USER_INIT      =  $0800;
  CSIDL_FLAG_NO_ALIAS           =  $1000;
  CSIDL_FLAG_DONT_VERIFY        =  $4000;
  CSIDL_FLAG_CREATE             =  $8000;
  CSIDL_FLAG_MASK               =  $FF00;

////////////////////////////////////////////////////////////////////////////////
//   Function prototype
////////////////////////////////////////////////////////////////////////////////
type
  TSHGetFolderPath        =  function(hwndOwner: HWND; nFolder: DWORD; hToken: THandle; dwFlags: DWORD; lpszPath: PChar): HResult; stdcall;

////////////////////////////////////////////////////////////////////////////////
//   Function name
////////////////////////////////////////////////////////////////////////////////
const
  SHGETFOLDERPATH_NAME    =  'SHGetFolderPathA';

////////////////////////////////////////////////////////////////////////////////
//   Function libraries
////////////////////////////////////////////////////////////////////////////////
const
  SHGETFOLDERPATH_LIBS:   Array [0..1] of PChar = ('shfolder.dll', 'shell32.dll');

////////////////////////////////////////////////////////////////////////////////
//   Dynamic loading structure
////////////////////////////////////////////////////////////////////////////////
type
  TSHGFPDyna              =  packed record
     hLib:                HINST;
     lpFunc:              TSHGetFolderPath;
  end;

////////////////////////////////////////////////////////////////////////////////
//
//   GetFolderPath
//
//   Arguments
//
//      CSIDL    -  Folder ID to retrieve the path for
//      Created  -  Returns true if the path was created, otherwise returns false
//
//   Returns the path for the specified folder ID.
//
//   Notes
//
//      Attempts to use the SHGetFolderPathA function from SHFOLDER.DLL first.
//      If this fails, it will attempt to load and resolve the funtion in
//      SHELL32.DLL and perform the call again.
//
////////////////////////////////////////////////////////////////////////////////
function   GetFolderPath(CSIDL: DWORD; out Created: Boolean): String; overload;
function   GetFolderPath(CSIDL: DWORD): String; overload;

////////////////////////////////////////////////////////////////////////////////
//
//   CSIDLFromName
//
//   Arguments
//
//      CSIDLName-  The CSIDL_CONSTANTNAME to convert
//      CSIDL    -  Out parameter to return the CSIDL value
//
//   Returns true / false success status.
//
////////////////////////////////////////////////////////////////////////////////
function   CSIDLFromName(CSIDLName: String; out CSIDL: DWORD): Boolean;

implementation

////////////////////////////////////////////////////////////////////////////////
//   Protected variables
////////////////////////////////////////////////////////////////////////////////
var
  listCSIDL:        TStringList;
  lpaDyna:          Array [0..1] of TSHGFPDyna;

function CSIDLFromName(CSIDLName: String; out CSIDL: DWORD): Boolean;
var  dwIndex:       Integer;
begin

  // Attempt to find name in list
  if listCSIDL.Find(UpperCase(CSIDLName), dwIndex) then
  begin
     // Get CSIDL for the name
     CSIDL:=DWORD(listCSIDL.Objects[dwIndex]);
     // Success
     result:=True;
  end
  else
     // Failed to locate name
     result:=False;

end;

function GetFolderPath(CSIDL: DWORD): String; overload;
var  bCreated:      Boolean;
begin

  // Call other overloaded version
  result:=GetFolderPath(CSIDL, bCreated);

end;

function GetFolderPath(CSIDL: DWORD; out Created: Boolean): String;
var  lpszPath:      Array [0..MAX_PATH] of Char;
     dwFlags:       DWORD;
     hrResult:      HResult;
     dwIndex:       Integer;
begin

  // Set default hResult
  hrResult:=E_NOTIMPL;

  // Attempt to call the function address from both libraries
  for dwIndex:=0 to 1 do
  begin
     // Set default flags
     dwFlags:=CSIDL;
     // Check function address
     if Assigned(@lpaDyna[dwIndex].lpFunc) then
     begin
        // Call the function
        hrResult:=lpaDyna[dwIndex].lpFunc(0, dwFlags, 0, SHGFP_TYPE_CURRENT, @lpszPath);
        // Check result, break if success
        if (hrResult = S_OK) then
           break
        // Check for not existing
        else if (hrResult = S_FALSE) then
        begin
           // Add create to the flags
           dwFlags:=dwFlags or CSIDL_FLAG_CREATE;
           // Peform the call again using the new flags
           hrResult:=lpaDyna[dwIndex].lpFunc(0, dwFlags, 0, SHGFP_TYPE_CURRENT, @lpszPath);
           // Check result
           if (hrResult = S_OK) then
              break
           // Check for not existing
           else if (hrResult = S_FALSE) then
           begin
              // Add dont' verify flag
              dwFlags:=dwFlags or CSIDL_FLAG_DONT_VERIFY;
              // Peform the call again using the new flags, (-1) default token handle, and "default" flag
              hrResult:=lpaDyna[dwIndex].lpFunc(0, dwFlags, THandle(-1), SHGFP_TYPE_DEFAULT, @lpszPath);
              // Check result
              if (hrResult = S_OK) then break;
           end;
        end;
     end;
  end;

  // Did we succeed?
  if (hrResult = S_OK) then
  begin
     // Set the path
     result:=lpszPath;
     // Set the Created flag
     Created:=((dwFlags and CSIDL_FLAG_CREATE) = CSIDL_FLAG_CREATE);
  end
  // Call special folder version
  else if SHGetSpecialFolderPath(0, @lpszPath, CSIDL, False) then
  begin
     // Set the path
     result:=lpszPath;
     // Set the Created flag
     Created:=False;
  end
  else
     // Failed to get path
     SetLength(result, 0);

end;

procedure InitLibraries;
var  dwIndex:       Integer;
begin

  // Attempt to load and call the function address from both libraries
  for dwIndex:=0 to 1 do
  begin
     // Load library
     lpaDyna[dwIndex].hLib:=LoadLibrary(SHGETFOLDERPATH_LIBS[dwIndex]);
     // Check load result
     if not(lpaDyna[dwIndex].hLib = 0) then
        // Get function address
        @lpaDyna[dwIndex].lpFunc:=GetProcAddress(lpaDyna[dwIndex].hLib, SHGETFOLDERPATH_NAME)
     else
        // Clear function address
        @lpaDyna[dwIndex].lpFunc:=nil;
  end;

end;

procedure LoadCSIDLList;
begin

  // Resource protection
  try
     // Add idents and values
     listCSIDL.AddObject('CSIDL_DESKTOP', Pointer(CSIDL_DESKTOP));
     listCSIDL.AddObject('CSIDL_INTERNET', Pointer(CSIDL_INTERNET));
     listCSIDL.AddObject('CSIDL_PROGRAMS', Pointer(CSIDL_PROGRAMS));
     listCSIDL.AddObject('CSIDL_CONTROLS', Pointer(CSIDL_CONTROLS));
     listCSIDL.AddObject('CSIDL_PRINTERS', Pointer(CSIDL_PRINTERS));
     listCSIDL.AddObject('CSIDL_PERSONAL', Pointer(CSIDL_PERSONAL));
     listCSIDL.AddObject('CSIDL_FAVORITES', Pointer(CSIDL_FAVORITES));
     listCSIDL.AddObject('CSIDL_STARTUP', Pointer(CSIDL_STARTUP));
     listCSIDL.AddObject('CSIDL_RECENT', Pointer(CSIDL_RECENT));
     listCSIDL.AddObject('CSIDL_SENDTO', Pointer(CSIDL_SENDTO));
     listCSIDL.AddObject('CSIDL_BITBUCKET', Pointer(CSIDL_BITBUCKET));
     listCSIDL.AddObject('CSIDL_STARTMENU', Pointer(CSIDL_STARTMENU));
     listCSIDL.AddObject('CSIDL_MYDOCUMENTS', Pointer(CSIDL_MYDOCUMENTS));
     listCSIDL.AddObject('CSIDL_MYMUSIC', Pointer(CSIDL_MYMUSIC));
     listCSIDL.AddObject('CSIDL_MYVIDEO', Pointer(CSIDL_MYVIDEO));
     listCSIDL.AddObject('CSIDL_DESKTOPDIRECTORY', Pointer(CSIDL_DESKTOPDIRECTORY));
     listCSIDL.AddObject('CSIDL_DRIVES', Pointer(CSIDL_DRIVES));
     listCSIDL.AddObject('CSIDL_NETWORK', Pointer(CSIDL_NETWORK));
     listCSIDL.AddObject('CSIDL_NETHOOD', Pointer(CSIDL_NETHOOD));
     listCSIDL.AddObject('CSIDL_FONTS', Pointer(CSIDL_FONTS));
     listCSIDL.AddObject('CSIDL_TEMPLATES', Pointer(CSIDL_TEMPLATES));
     listCSIDL.AddObject('CSIDL_COMMON_STARTMENU', Pointer(CSIDL_COMMON_STARTMENU));
     listCSIDL.AddObject('CSIDL_COMMON_PROGRAMS', Pointer(CSIDL_COMMON_PROGRAMS));
     listCSIDL.AddObject('CSIDL_COMMON_STARTUP', Pointer(CSIDL_COMMON_STARTUP));
     listCSIDL.AddObject('CSIDL_COMMON_DESKTOPDIRECTORY', Pointer(CSIDL_COMMON_DESKTOPDIRECTORY));
     listCSIDL.AddObject('CSIDL_APPDATA', Pointer(CSIDL_APPDATA));
     listCSIDL.AddObject('CSIDL_PRINTHOOD', Pointer(CSIDL_PRINTHOOD));
     listCSIDL.AddObject('CSIDL_LOCAL_APPDATA', Pointer(CSIDL_LOCAL_APPDATA));
     listCSIDL.AddObject('CSIDL_ALTSTARTUP', Pointer(CSIDL_ALTSTARTUP));
     listCSIDL.AddObject('CSIDL_COMMON_ALTSTARTUP', Pointer(CSIDL_COMMON_ALTSTARTUP));
     listCSIDL.AddObject('CSIDL_COMMON_FAVORITES', Pointer(CSIDL_COMMON_FAVORITES));
     listCSIDL.AddObject('CSIDL_INTERNET_CACHE', Pointer(CSIDL_INTERNET_CACHE));
     listCSIDL.AddObject('CSIDL_HISTORY', Pointer(CSIDL_HISTORY));
     listCSIDL.AddObject('CSIDL_COMMON_APPDATA', Pointer(CSIDL_COMMON_APPDATA));
     listCSIDL.AddObject('CSIDL_WINDOWS', Pointer(CSIDL_WINDOWS));
     listCSIDL.AddObject('CSIDL_SYSTEM', Pointer(CSIDL_SYSTEM));
     listCSIDL.AddObject('CSIDL_PROGRAM_FILES', Pointer(CSIDL_PROGRAM_FILES));
     listCSIDL.AddObject('CSIDL_MYPICTURES', Pointer(CSIDL_MYPICTURES));
     listCSIDL.AddObject('CSIDL_PROFILE', Pointer(CSIDL_PROFILE));
     listCSIDL.AddObject('CSIDL_SYSTEMX86', Pointer(CSIDL_SYSTEMX86));
     listCSIDL.AddObject('CSIDL_PROGRAM_FILESX86', Pointer(CSIDL_PROGRAM_FILESX86));
     listCSIDL.AddObject('CSIDL_PROGRAM_FILES_COMMON', Pointer(CSIDL_PROGRAM_FILES_COMMON));
     listCSIDL.AddObject('CSIDL_PROGRAM_FILES_COMMONX86', Pointer(CSIDL_PROGRAM_FILES_COMMONX86));
     listCSIDL.AddObject('CSIDL_COMMON_TEMPLATES', Pointer(CSIDL_COMMON_TEMPLATES));
     listCSIDL.AddObject('CSIDL_COMMON_DOCUMENTS', Pointer(CSIDL_COMMON_DOCUMENTS));
     listCSIDL.AddObject('CSIDL_COMMON_ADMINTOOLS', Pointer(CSIDL_COMMON_ADMINTOOLS));
     listCSIDL.AddObject('CSIDL_ADMINTOOLS', Pointer(CSIDL_ADMINTOOLS));
     listCSIDL.AddObject('CSIDL_CONNECTIONS', Pointer(CSIDL_CONNECTIONS));
     listCSIDL.AddObject('CSIDL_COMMON_MUSIC', Pointer(CSIDL_COMMON_MUSIC));
     listCSIDL.AddObject('CSIDL_COMMON_PICTURES', Pointer(CSIDL_COMMON_PICTURES));
     listCSIDL.AddObject('CSIDL_COMMON_VIDEO', Pointer(CSIDL_COMMON_VIDEO));
  finally
     // Sort the list
     listCSIDL.Sort;
  end;

end;

initialization

  // Initialize libraries
  InitLibraries;

  // Create the list
  listCSIDL:=TStringList.Create;

  // Load it
  LoadCSIDLList;


finalization

  // Free the list
  listCSIDL.Free;

end.
0
 

Author Comment

by:SHAHEEN_AKHTAR
ID: 21766135
Thanks both of you experts. I will implement today and come back. cheers.
0
 

Author Comment

by:SHAHEEN_AKHTAR
ID: 21790761
Both the codes I used and I got the folder names but when I try to save xml file using XmlDocument.SaveToFile(FilePath) I get access denied. Any tip please.

Thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Expert Comment

by:SteveBay
ID: 21792216
Sound like a Windows rights issue. To test this, try to create a text file in that folder using Windows Explorer. If you cannot, then you must increase the user's rights to allow file create in that folder or choose a folder where the user has appropriate rights.
0
 

Author Comment

by:SHAHEEN_AKHTAR
ID: 21837438
Yes you are right. I am developing an IE tool bar it is complete minus this issue. If my client installs this tool bar, I have to programmatically set the write permissions, which I hope not possible for special folders. I wanted to achieve the functionality like IE stores files in temporary internet files whenever it is navigates to a URL.
I will test it with
IE:Iwebbrowser2;
IE.visible := False;
IE.Navigate('url of the xml file');

Before that any solution comes in, kindly post it.

Thanks a lot
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 21858112
Are you testing this on Vista by chance? You should have permissions to this folder UNLESS you are running on Vista, which treats this as a protected folder. My recommendation would be to set up your own folder eg, under GetFolderPath(CSIDL_APPDATA) + '\YourApplication'

which would be:

"C:\Documents and Settings\{YourUserAccount}\Application Data\YourApplication"

This way, you will have control over the folder (and files) and not have to worry about the OS inconsistiencies.

Russell
0
 

Author Comment

by:SHAHEEN_AKHTAR
ID: 21888649
I am trying on XP SP2.  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

867 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

17 Experts available now in Live!

Get 1:1 Help Now