private void button5_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process ie = new System.Diagnostics.Process();
ie.StartInfo.FileName = "IEXPLORE.EXE";
ie.StartInfo.Arguments = "http://www.csdn.net";
ie.Start();
}
{
System.Diagnostics.Process ie = new System.Diagnostics.Process();
ie.StartInfo.FileName = "IEXPLORE.EXE";
ie.StartInfo.Arguments = "http://www.csdn.net";
ie.Start();
}
我希望傳個"ABC"過去應當怎麼做呢
ie.StartInfo.FileName = "IEXPLORE.EXE";
ie.StartInfo.Arguments = "http://www.csdn.net";
ie.Start();这样调可以吗?ie会不会在前面和后面加上一串字符串(自动在前面加http:// 自动在后面加/20%)?不过我知道这样用mathon是绝对可以打开本地文件或者网页的。
例如:
using System.Diagnostics; //其他代码(略) private void btnDone_Click(object sender, System.EventArgs e)
{
string mathonPath=@"C:\Program Files\Maxthon\\Maxthon.exe";
string iePath=@"C:\Program Files\Internet Explorer\IEXPLORE.EXE"; Process p = new Process();
//设定程序名
p.StartInfo.FileName=mathonPath;
//关闭Shell的使用
p.StartInfo.UseShellExecute = false;
//重定向标准输入
p.StartInfo.RedirectStandardInput = true;
//重定向标准输出
p.StartInfo.RedirectStandardOutput = true;
//重定向错误输出
p.StartInfo.RedirectStandardError = true;
//设置不显示窗口
p.StartInfo.CreateNoWindow = true; p.StartInfo.Arguments="D:\\pic\\01.jpg";
/*或者打开一个网页
p.StartInfo.Arguments="www.gdxtgt.com.cn";
*/
p.Start()
请看看我提的一个问题:
http://community.csdn.net/Expert/topic/3649/3649562.xml?temp=.7207758说的就是这个问题。