用WebClient上传文件时,提示远程服务器返回错误:(403)已禁止,这个是什么原因?
private void button4_Click(object sender, EventArgs e)
{
String sPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
sPath = sPath.Substring(0, sPath.LastIndexOf('\\') + 1);
Image newImage = Image.FromFile(sPath + "PMimages\\image_HE.png");
button5.Image = newImage;
//Stream myStream = null;
OpenFileDialog dlg = new OpenFileDialog();
string COMPRESSEDPACKAGE = m_ReadResDLL.ReadString(IDInResDLL.IDS_COMMON_COMPRESSEDPACKAGE);
dlg.Filter = "RAR(" + COMPRESSEDPACKAGE + ") files (*.rar)|*.rar|All files (*.*)|*.*";
//dlg.Filter = "RAR(压缩包) files (*.rar)|*.rar|All files (*.*)|*.*"; //中文比较
dlg.FilterIndex = 1;
dlg.RestoreDirectory = true;
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
// Insert code to read the stream here.
string strFile = dlg.FileName;
string strFilename = strFile.Substring(strFile.LastIndexOf("\\") + 1);
strFilename = strFilename.Substring(0, strFilename.IndexOf("."));