try
{
if (this.txtName.Text == "")
{
this.lblConnView.Text = "请输入姓名!";
this.txtName.Focus();
return;
}//Pass the filepath and filename to the StreamWriter Constructor
StreamWriter sw = new StreamWriter(Application.StartupPath + @"/ip.txt");//Write a line of text
sw.WriteLine(this.txtName.Text.Trim());//Close the file
sw.Close();MessageBox.show("成功");
}
catch(Exception ex)
{
throw ex;
}为什么这两处的MessageBox都不能用了,我点这个按钮事件就系统就很慢,响应半天没反应没分了,大家照顾一家新手吧
{
if (this.txtName.Text == "")
{
this.lblConnView.Text = "请输入姓名!";
this.txtName.Focus();
return;
}//Pass the filepath and filename to the StreamWriter Constructor
StreamWriter sw = new StreamWriter(Application.StartupPath + @"/ip.txt");//Write a line of text
sw.WriteLine(this.txtName.Text.Trim());//Close the file
sw.Close();MessageBox.show("成功");
}
catch(Exception ex)
{
throw ex;
}为什么这两处的MessageBox都不能用了,我点这个按钮事件就系统就很慢,响应半天没反应没分了,大家照顾一家新手吧
解决方案 »
- 求助 C# 有关Timer的应用问题
- 最小化到托盘的问题
- PDF拆分问题——PDFBOX
- 这种文件该怎么读写?
- 在局域网上能否用POS方式操作小票打印机?
- 怎么获取.cs文件里的类名
- ----怎样检测到每个函数占用的cpu时间?----
- 求助:DataTable、DataGridView操作 以及 两个窗口之间传值的问题
- 谁能告诉我在c#中上下左右键的代码是多少?
- StructLayout类是干什么用的,它有什么用,什么时候用它呀?????????????
- 多個button共用一個事件,但對應不同的button時執行段不一樣。示例如下。
- 怎样在.NET2003窗口模式下运行外部程序(*.exe文件)???求高手指点!!!
应该都没有执行到这句,你断点调试看下..
很奇怪,大家帮帮我