Hi, I'm having a problem with this. I don't know why it could be. I'm trying to access a file in a directory located in the bin/Debug or bin/Release folder of the c#.net 2003 project. I access it like this:
string file = "Folder1\\Folder2\\File.ext";
where the folder is located, as I said, in ProjectFolder\bin\Debug or ProjectFolder\bin\Release
¿When I access this folder, why is the DirectoryNotFoundException thrown?
Why if I put these folders into ProjectFolder\ and accessing with:
When you're using relative paths, you always have to be sure what's the current directory of the application.
You should NEVER assume anything regarding on what the current directory is, even showing an OpenFileDialog can change the current directory!
If you need a directory relative to your exe, you should use Application.StartupPath and build the path from there.
-- Black holes are the places where god divided by 0...
As you see from the behaviour, this structure IS a valid path but you obviously do not know why. When you add ..\..\ you are telling File that you are accessing a folder relative to the current directory. In this case the Debug or Release folder of your application.
Follow the other suggestion and append your path with your Application ExecutablePath
I set my projects up to use an external directory structure (out side of the project\\bin\\..).
For example, inside my code I will setup some directory strings as the path to certain folders.
GetCurrentDirectory() + "\\Data\\" is where I would store my database.
GetCurrentDirectory() + "\\Art\\" is where I store my art files.
To set this up, inside the .NET project properties set the Output Pathto ..\\Folder\
i am accessing visio's objects programmatically. I am able to know that in a page how many shape are there and what type of shapes are they. Now I want is to know that class object(s) in a window posses how many properties, Method, className etc. I am able to find out the descricption of process, doc, terminator etc. info. But problem with class object is it contains data in row format. plz do reply soon.
I am experimenting with threading and I made the following simple program:
Thread blue = new Thread(new ThreadStart(bluebegin) );
Thread yellow = new Thread(new ThreadStart(yellowbegin) );
Thread red = new Thread(new ThreadStart(redbegin) );
public void bluebegin()
this.BackColor = Color.Blue;
public void yellowbegin()
this.BackColor = Color.Yellow;
public void redbegin()
this.BackColor = Color.Red;
I don´t know how to stop one or all threads. I have tried adding to one of the methods : blue.Abort(); but then I am told that the namespace blue could not be found. Can someone please help me?
I am facing a problem when using VSTS with NUnit 2.2.6.
I am testing a website. After opening the browser it closes immidiately and
I am getting the following error.
Info: Failed to execute test cases due to run time error: ‘The HWnd is no longer valid’
Is the problem with NUnit 2.2.6? Let me know.
Thanks in advance
Last Visit: 31-Dec-99 18:00 Last Update: 29-Sep-23 18:14