Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

c# locate resource file

Posted on 2011-03-01
4
Medium Priority
?
386 Views
Last Modified: 2013-12-17
Hi,
I develop my app on eg. f:\myapp\ where I save my resource file in the app.conf where
I indicate my resource file location as f:\myapp\resources\res.bin.
When I copy my program to other computer and run on c:\ drive. The program coult not start because it is looling for f:\ drive. How can I solve this issue?

Thanks,
JT
0
Comment
Question by:jtran007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Assisted Solution

by:crysallus
crysallus earned 800 total points
ID: 35014788
To specify the file resources\res.bin relative to the location of the executable, use:

Application.StartupPath + Path.DirectorySeparatorChar + "resources" + Path.DirectorySeparatorChar + "res.bin"

Open in new window

0
 
LVL 7

Accepted Solution

by:
mkobrin earned 1200 total points
ID: 35014794
Go to the properties of your resource file in you Visual Studio IDE and set the option to copy the resource locally and then recompile the code. The resource file will then be local, and you will not have to another drive to find it.
0
 

Author Comment

by:jtran007
ID: 35023702
HI,

But what is the syntax to open this file? ".\resources\res.bin"

Thanks,
JT
0
 

Author Closing Comment

by:jtran007
ID: 35380741
Thanks,
JT
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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