高分求救:未将对象引用设置到对象的实例 1.InstruFileName is not defined? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 change:private void btnInstru_Click(object sender, System.EventArgs e){ try { int i = 0; for(i=0; i<4; i++) { if(InstruFileName[i].Length == 0) break; } if(i >= 4) { MessageBox.Show("为便于演示,一般打开指令文件数小于等于4个"); } if(this.openFileDialog.ShowDialog() == DialogResult.OK ) { InstruFileName[i] = this.openFileDialog.FileName; this.listBox1.Items.Add(InstruFileName[i] + "\n"); } } catch (System.Exception ex) { string strEx = ex.Message; } }看看你的提示得异常是由于什么原因引起的?还有,InstruFileName你是否作过初始化?第2个问题,process() InstruFileName 在前面已经定义了啊,是个数组 1。InstruFileName 没有定义并实例化2。 string filename="d:\\Exp.doc"; try { System.Diagnostics.Process.Start(filename); } catch(Exception er){throw er;}3。4。 没有安装 不好调试:) mywebcom: processs()具体怎么用啊 能不能给我个实例? 我觉得可能是这句有问题InstruFileName[i] = this.openFileDialog.FileName; 我在前面已经 string[] InstruFileName = new string[5]; 1.设断点看看哪里出错,贴出来2. System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = HttpContext.Current.Request.PhysicalApplicationPath+@"\bin\auth.exe";// p.StartInfo.FileName = @"D:\Program Files\Internet Explorer\IExplore.exe";// p.StartInfo.Arguments = HttpContext.Current.Request.PhysicalApplicationPath+@"\bin\test.asp"; p.Start(); verifyNo = p.StandardOutput.ReadLine(); p.Dispose(); p.Close();3.4 没用过 检查一下this.openFileDialog.FileName;它的值为空 InstruFileName[i]这个数组没实例化吧? 想来你的程序是通过了编译的了是不是在下面:for(i=0; i<4; i++) { if(InstruFileName[i].Length == 0) break; }你是要找一个没有使用的InstruFileName[i]的吧,InstruFileName[i]是不是原来就有string类型的实例?因为在刚开始的时候,InstruFileName[i]的值为null 而不是""(空字符串)所以InstruFileName[i].Lenth等价于null.Lenth !!这是在运行时是非法的,但能通过编译 不好意思,下午去上课了,刚回来wuyeniao(巷陌·清茶): 说的很对;当时考虑用了C++里的习惯,不过后来我经过单步调试已经找出了,现在关键是第三四个问题了,忘高人能指点一二Dundas chart 不是听说很好用的嘛? 有用过的人可否指点啊? 问题肯定出现在InstruFileName[i]上面只要单步跟踪一下看看InstruFileName[i]是否总能指向存在的文件 前面已经定义了i.后面在for循环里面还能用吗? 我稍微改了一下判断条件久好了for(i=0; i<4; i++) { if(InstruFileName[i] == null) break; } c# webservice 怎么把Namespace参数化 关于c# Windows窗体控件代码 问一个正则表达式 十万条记录,怎样插入数据库最高效 vs.net2003c# 在winfrm中如何实现OFFICE菜单效果 如何用程序移动在textBox中的光标。也就是用程序实现'-->'键的功能!。望高手指教。 C#中判断整型数字是否为空这样写不对? 各位大哥,小弟有个小问题想请教 C# 中鼠标左右键同时按下的事件是什么? 修改进程名 明天LP生日,今天提前送分 请问:如何获得propergrid控件的属性值,谢谢!!
private void btnInstru_Click(object sender, System.EventArgs e)
{
try
{
int i = 0;
for(i=0; i<4; i++)
{
if(InstruFileName[i].Length == 0)
break;
}
if(i >= 4)
{
MessageBox.Show("为便于演示,一般打开指令文件数小于等于4个");
}
if(this.openFileDialog.ShowDialog() == DialogResult.OK )
{
InstruFileName[i] = this.openFileDialog.FileName;
this.listBox1.Items.Add(InstruFileName[i] + "\n");
}
}
catch (System.Exception ex)
{
string strEx = ex.Message; }
}
看看你的提示得异常是由于什么原因引起的?
还有,InstruFileName你是否作过初始化?第2个问题,process()
InstruFileName 在前面已经定义了啊,是个数组
string filename="d:\\Exp.doc";
try
{
System.Diagnostics.Process.Start(filename);
}
catch(Exception er){throw er;}3。4。 没有安装 不好调试:)
mywebcom:
processs()具体怎么用啊
能不能给我个实例?
InstruFileName[i] = this.openFileDialog.FileName;
我在前面已经
string[] InstruFileName = new string[5];
2. System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = HttpContext.Current.Request.PhysicalApplicationPath+@"\bin\auth.exe";
// p.StartInfo.FileName = @"D:\Program Files\Internet Explorer\IExplore.exe";
// p.StartInfo.Arguments = HttpContext.Current.Request.PhysicalApplicationPath+@"\bin\test.asp";
p.Start();
verifyNo = p.StandardOutput.ReadLine();
p.Dispose();
p.Close();
3.4 没用过
它的值为空
是不是在下面:
for(i=0; i<4; i++)
{
if(InstruFileName[i].Length == 0)
break;
}
你是要找一个没有使用的InstruFileName[i]的吧,
InstruFileName[i]是不是原来就有string类型的实例?因为在刚开始的时候,InstruFileName[i]的值为null 而不是""(空字符串)所以InstruFileName[i].Lenth等价于null.Lenth !!这是在运行时是非法的,但能通过编译
不好意思,下午去上课了,刚回来wuyeniao(巷陌·清茶): 说的很对;当时考虑用了C++里的习惯,不过后来我经过单步调试已经找出了,现在关键是第三四个问题了,忘高人能指点一二Dundas chart 不是听说很好用的嘛? 有用过的人可否指点啊?
只要单步跟踪一下看看InstruFileName[i]是否总能指向存在的文件
我稍微改了一下判断条件久好了
for(i=0; i<4; i++)
{
if(InstruFileName[i] == null)
break;
}