Files loading

  • Thread starter Thread starter Xarky
  • Start date Start date
X

Xarky

Hi,
I have an application that makes up of files(reading data). Files
are currently located on drive C. Now I am going to write the program
and the files being used to a CD. The program is going to be executed
on different computers and so the CD-Rom drive letter is not going to
be the same on all computers.

When I load a file from harddisk I do as follows
(@"c:\fileName")

Can someone help me solve my problem.


Thanks in Advance
 
I would put all of the files into a folder called "files"(or whatever suits
you), and place that folder in the same directory as your application. To
load them, you wouldn't have to specify a drive letter, rather just the
directory name. So if your program were "D:\myapp.exe" you could load the
files by using (@"\files\filename")
 
Hi,
I tried the instruction as told, but it is not working. It is
giving me the following error

"An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll

Additional information: Invalid parameter used."

I am doing as follows
Bitmap x = new Bitmap(@"\Figures\SequenceExample.bmp");
where folder Figures is in the folder of my project.

How should I solve this.
 
I tried the code you posted and recieved the same message. I'm not sure
why this is, but I did find a way around it. Try using this--

string picturepath = Application.StartupPath+@"\Figures\SequenceExample.bmp";
Bitmap X = new Bitmap(picturepath);


good luck with your project :
--------------------------------------------------------------------------------
 
I tried the code you posted and recieved the same message. Not sure why
this is, but I did manage to find a way around the error. Try this--

string picpath = Application.StartupPath+@"\Figures\SequenceExample.bmp";
Bitmap X = new Bitmap(picpath);

Good luck on your project :)
---------------------------------
 
Thanks for your help, problem solved


Jeff Ciesielski said:
I tried the code you posted and recieved the same message. Not sure why
this is, but I did manage to find a way around the error. Try this--

string picpath = Application.StartupPath+@"\Figures\SequenceExample.bmp";
Bitmap X = new Bitmap(picpath);

Good luck on your project :)
 
Back
Top