Winform启动另一个项目传值的方法
本文实例讲述了Winform启动另一个项目传值的方法。分享给大家供大家参考。具体如下:
背景:从A项目中登陆后,跳转到B项目的某个页面(B不再登陆)。
A项目启动进程:
publicForm1()
{
InitializeComponent();
}
#region调用进程
[DllImport("Shell32.dll")]
privatestaticexternintShellExecute(
IntPtrhwnd,
stringlpOperation, //多为"open"
stringlpFile, //文件名称
stringlpParameters, //参数
stringlpDirectory, //文件路径
intnShowCmd
);
///<summary>
///加载相应的应用程序
///</summary>
privatevoidStartApplication(stringprojname,stringarg)
{
ShellExecute(IntPtr.Zero,"Open",projname,arg,Application.StartupPath+@"\",1);
}
#endregion
privatevoidbtnJump_Click(objectsender,EventArgse) { StartApplication("B","Doctor,00045,14092701");//从这里跳转 }