当前位置:首页 > Windows程序 > 正文

Application.StartupPath + @”\”

2024-03-31 Windows程序

配景:从A项目中登陆后,,跳转到B项目的某个页面(B不再登陆)。

A项目启动进程:


代码如下:


public Form1()

{

InitializeComponent();

}

#region 挪用进程

[DllImport(“Shell32.dll”)]

private static extern int ShellExecute(

IntPtr hwnd,

string lpOperation,      //多为”open”

string lpFile,           //文件名称

string lpParameters,   //参数

string lpDirectory,      //文件路径

int nShowCmd

);

/// <summary>

/// 加载相应的应用措施

/// </summary>

private void StartApplication(string projname, string arg)

{

ShellExecute(IntPtr.Zero, “Open”, projname, arg, Application.StartupPath + @”\”, 1);

}

#endregion


private void btnJump_Click(object sender, EventArgs e)

{

StartApplication(“B”, “Doctor,00045,14092701”);//从这里跳转

}

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/36163.html

Jm-杰米博客Jamie
草根站长的技术交流乐园!IT不会不要紧快来好好学习吧!
  • 20786文章总数
  • 7494592访问次数
  • 建站天数
  • 友情链接