Small C# issue.

Associate
Joined
14 Jan 2010
Posts
1,192
Location
Northern Ireland
I'm programming an application which also happens to start Crysis 2, however a small problem with starting the application is that I need to use "\b" which create some sort of special character.

Code:
            Process crysis2 = new Process();
            crysis2.StartInfo.FileName = "Crysis2";
            crysis2.StartInfo.WorkingDirectory = @path+"\bin32";
            crysis2.Start();

Where path = D:\Steam\steamapps\common\crysis2

I know that isn't where the problem is, it's with that \b thing, and I can't seem to figure out away around it.
 
Just use a double backslash to escape the special character or use another @ symbol.

eg
crysis2.StartInfo.WorkingDirectory = @path+"\\bin32";
or
crysis2.StartInfo.WorkingDirectory = @path + @"\bin32";

That should do the trick :)

I didn't even think of that :o

Thanks. :)
 
Back
Top Bottom