我编写了一段用于上传文件的代码但是出错了请高手指正下,怎么做
private void button1_Click(object sender, System.EventArgs e)
{
if(this.openFileDialog1.ShowDialog()==DialogResult.OK)
{
this.textBox1.Text=this.openFileDialog1.FileName;
}
} private void button2_Click(object sender, System.EventArgs e)
{
if(this.textBox1.Text=="" || this.textBox2.Text=="")
return;
WebClient MyClient=new  WebClient();
string URL=this.textBox1.Text;
string FileName=this.textBox2.Text;
byte[] MyResponseArray=null;
try
{
MyResponseArray=MyClient.UploadFile(URL,FileName);
MessageBox.Show("文件上传成功!","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

}
catch(Exception Err)
{
MessageBox.Show("文件上传失败!错误是:"+Err.Message,"信息提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
finally
{
MessageBox.Show("\n  服务器的回复为: \n"+System.Text.Encoding.ASCII.GetString(MyResponseArray) );
}
}给出来的错误信息是:未处理的“System.ArgumentNullException”类型的异常出现在 mscorlib.dll 中。其他信息: 数组不能为空。