dataSynFile = Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\") -3)+<span style="background-color: rgb(0, 0, 0);">"數據同步解決方案</span>\\xml";
System.Diagnostics.Process.Start("explorer.exe", dataSynFile);
</pre><pre name="code" class="html">
dataSynFile = Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\") - 3) + "<span style="background-color: rgb(0, 0, 0);">數據同步解決方案\\數據同步解決方案</span>.exe.config";
System.Diagnostics.Process.Start("explorer.exe", dataSynFile);
</pre><pre name="code" class="html">
dataSynFile = Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\") - 3) + "<span style="background-color: rgb(0, 0, 0);">數據同步解決方案\\數據同步解決方案</span>.exe";
System.Diagnostics.Process.Start("explorer.exe", dataSynFile);
用該方法均可以打開
Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\") -3)
這句話去讀該根目錄然後截取自己想要的目錄位置,此處依自己的情況而設置