怎样用一个文件打开另一个文件 我想设置一个按钮实现用一个openDialog打开的文件,例如是一个rmvb的文件,之后再用一个openDialog打开另一个文件,例如暴风影音的exe文件,请问怎样设置一个button实现用第二个打开的exe文件打开第一个rmvb文件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 openDialog选择第一个文件的时候用一个文本控件保存它的路径在打开暴风影音的时候用参数打开。public void Button1_Click(....){ System.Diagnostics.ProcessStartInfo info = new ProcessStartInfo("c://暴风影音.exe"); info.Arguments = "c//播放.rmvb"; System.Diagnostics.Process pro = new Process(); pro.StartInfo = info; pro.Start();} OpenFileDialog filedia = new OpenFileDialog(); string filename = string.Empty; string openfilename = string.Empty; if (filedia.ShowDialog() == DialogResult.OK) { filename = filedia.FileName; OpenFileDialog open = new OpenFileDialog(); if (open.ShowDialog() == DialogResult.OK) { filename = open.FileName; } } ProcessStartInfo start = new ProcessStartInfo(openfilename, filename); Process.Start(start); 那就是启动一个进程了应该是,启动一个进程,给这个进程传参数,其中包括第一个opendialog打开的文件的路径 OpenFileDialog filedia = new OpenFileDialog(); string filename = string.Empty; string openfilename = string.Empty; if (filedia.ShowDialog() == DialogResult.OK) { filename = filedia.FileName; OpenFileDialog open = new OpenFileDialog(); if (open.ShowDialog() == DialogResult.OK) { openfilename = open.FileName; } } ProcessStartInfo start = new ProcessStartInfo(openfilename, filename); Process.Start(start);sorry 打错了。差不多就这个意思。。自己试试吧。 读取word文档操作 comboBox获取文本档每行的数据 求助(怪问题):程序关闭后以后,探出*.exe-“应用程序错误”提示,那位大侠遇到过这样的问题,救救俺! 一个十分奇怪的问题期待高手解决 在C#环境下用VC方法画鼠标,怎样修改才能实现目标? 请教多项式的加、减、乘、除 @@@@在线求教新手问题··· 再问刚才的问题(字符串转换成运算 ) 请问VC#中怎么打印预览图片啊??? 如何调整Panel的线宽啊 一个很怪的现象 使用了未赋值的局部变量“Row”
在打开暴风影音的时候用参数打开。public void Button1_Click(....)
{
System.Diagnostics.ProcessStartInfo info = new ProcessStartInfo("c://暴风影音.exe");
info.Arguments = "c//播放.rmvb";
System.Diagnostics.Process pro = new Process();
pro.StartInfo = info;
pro.Start();
}
string filename = string.Empty;
string openfilename = string.Empty;
if (filedia.ShowDialog() == DialogResult.OK)
{
filename = filedia.FileName;
OpenFileDialog open = new OpenFileDialog();
if (open.ShowDialog() == DialogResult.OK)
{
filename = open.FileName;
}
} ProcessStartInfo start = new ProcessStartInfo(openfilename, filename);
Process.Start(start);
应该是,启动一个进程,给这个进程传参数,其中包括第一个opendialog打开的文件的路径
string filename = string.Empty;
string openfilename = string.Empty;
if (filedia.ShowDialog() == DialogResult.OK)
{
filename = filedia.FileName;
OpenFileDialog open = new OpenFileDialog();
if (open.ShowDialog() == DialogResult.OK)
{
openfilename = open.FileName;
}
}
ProcessStartInfo start = new ProcessStartInfo(openfilename, filename);
Process.Start(start);sorry 打错了。
差不多就这个意思。。自己试试吧。