problem in load file

I wrote one program that load a text file. it work well. I try to put my program in installer(visual studio .Net2008 ), when I run my program in x64 bit windows 7,my program cannot work because, it try to read below location but it can not access to the file, would you please advice me?

** path of the file creating dynamically!!!

string FILEPATH = Directory.GetCurrentDirectory() + "\\GameData\\savedata.ahd";

the result is this!from this pass my program cannot load the txt file! but in C:\program Files\FTE\Co... I dont have any problem!

C:\Program Files (x86)\FTE\CoTM\GameData\savedata.ahd

-------------Problems Reply------------

You're having access problems, because Windows 7 won't let you access the Program Files directory, see here for more information, and where you should store the files: http://windowsteamblog.com/windows/b/developers/archive/2009/08/04/user-account-control-data-redirection.aspx

you should add the file as a resource to the installer or put it within the same directory level of the installer. Hard coding file paths within setups dont work on machines other than yours.

Category:c# Views:0 Time:2010-11-28
Tags: c# c# 2.0

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.121 (s). 11 q(s)