File reference in Visual Basic
-
I created a reference to a file at some location in the hard drive in a vb.net application.
db_optb.Image = Image.FromFile("F:\Documents and Settings\Raza\My Documents\My Pictures\quiz_pics\opt_bg_post.jpg")
The program executed fine. But when i took the whole project folder to another PC and executed it there it gave a 'File does not exist' exception. Definitely the file was not there in this PC. So can place the file in the project and refer it in such a way that taking the project to any other place does not create problems?
-
I created a reference to a file at some location in the hard drive in a vb.net application.
db_optb.Image = Image.FromFile("F:\Documents and Settings\Raza\My Documents\My Pictures\quiz_pics\opt_bg_post.jpg")
The program executed fine. But when i took the whole project folder to another PC and executed it there it gave a 'File does not exist' exception. Definitely the file was not there in this PC. So can place the file in the project and refer it in such a way that taking the project to any other place does not create problems?
Razanust wrote:
I created a reference to a file at some location
That's not a reference, that's loading something from a specific path.
Razanust wrote:
So can place the file in the project and refer it in such a way that taking the project to any other place does not create problems?
Bastard Programmer from Hell :suss:
-
Razanust wrote:
I created a reference to a file at some location
That's not a reference, that's loading something from a specific path.
Razanust wrote:
So can place the file in the project and refer it in such a way that taking the project to any other place does not create problems?
Bastard Programmer from Hell :suss:
+5, Thats how I'd approach it too
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch