How can I change the root path that an application uses to upload a file from?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user033088
    New Member
    • Mar 2013
    • 25

    How can I change the root path that an application uses to upload a file from?

    I have an application which is used for calibration for electrical components. Here I want to set a rootpath for this application. I did some research and I found out that I can get the rootpath of the application (that is where the exe is stored) But what I am really looking for is once I start the application the root path should be what I assign. For instance currently the root path is "C:\Users\Publi c\Documents\ABC .Tools\Projects " but I would like the root path to be "E:\New ABC\"
    Is this possible? I wrote some code where I call the exe of the application and it opens the file in a folder that I specify :


    Code:
    private void NewJournal_Click(object sender, EventArgs e)
    {
    
    string filePath = @"E:\New ABC\abc.vnalog"
    if (!File.Exists(filePath))
    {
    return;
    }
    
    string SelectedFile = @"/select, " + filePath;
    System.Diagnostics.Process.Start(@"E:\New ABC\abc.vnalog", SelectedFile);
    
    }
    Now this code open the .vnalog file in the application. And this works great..!!! How can I now change the path within the application?
    Thanks in advance for your help.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This path in Windows:

    "E:\New ABC\abc.vnalog"

    is this path in C/C++

    "E:\\New ABC\\abc.vnalog "

    since the \ is an escape sequence.

    Comment

    Working...