CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Posts
    20

    how to start games

    ok i have a trouble here, when i try to start a game with

    System.Diagnostics.Process.Start(@"path");

    the game cant axcess its own files, is says like couldnt find the file ect BUT the files are there

    how do i start a game with c# that uses other files??

  2. #2
    Join Date
    Mar 2006
    Location
    Craiova, Romania
    Posts
    439

    Re: how to start games

    Post some code from your game and post the exceptions you get .

  3. #3
    Join Date
    Aug 2006
    Posts
    16

    Re: how to start games

    When you make this call

    System.Diagnostics.Process.Start(@"path");

    what is the current working directory?

  4. #4
    Join Date
    Aug 2006
    Posts
    20

    Re: how to start games

    working directiry?

  5. #5
    Join Date
    Aug 2006
    Posts
    16

    Re: how to start games

    What I mean is that the process you are starting will use the parent process working directory unless you specifically specify it and if the program starting the process is not in the same directory as the program to be started it will not find any of its files.

    You need to use the StartInfo Class to specify a working directory and program

    Code:
    ProcessStartInfo ProgInfo = new ProcessStartInfo(FilePath);
    Prog.WorkingDirectory = WorkingDir;
    Process prog = new Process(ProgInfo);

  6. #6
    Join Date
    Aug 2006
    Posts
    20

    Re: how to start games

    thanks now it working perfect

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured