配景:从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”);//从这里跳转
}