C#一道题 请高手指点

来源:百度知道 编辑:UC知道 时间:2024/05/08 23:08:24
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Text;

namespace Edit
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblFileName;
private System.Windows.Forms.TextBox txtFileName;
private System.Windows.Forms.TextBox txtContent;
private System.Windows.Forms.Button btnSave;
private System.ComponentModel.Container components = null;

public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
[STAThread]
static void Main()
{
Application.Run(new Form1());<

没看出程序有什么问题,
你到底想要做什么?
不过我好像没这么用过,
我用时一个方法里有一个try,多个catch,一个fianlly(或没有)。
catch (ArgumentOutOfRangeException e)
{
}
catch (ArgumentNullException e)
{
}
catch (ArgumentException e)
{
}
catch (Exception e)
{
}
可以写捕捉异常的类型,但 Exception 是异常的集合,必须放在最后。

废话,赋一个值就可以了~