C# を使用して、Windows アプリケーションからサーバーの特定のフォルダーにファイルをアップロードしようとしています。ただし、例外が発生します。
「WebClient リクエスト中に例外が発生しました」。
これが私のコードです:
for (int i = 0; i < dtResponseAttach.Rows.Count; i++)
{
string filePath = dtResponseAttach.Rows[i]["Response"];
WebClient client = new WebClient();
NetworkCredential nc = new NetworkCredential();
Uri addy = new Uri("http://192.168.1.4/people/Attachments/");
client.Credentials = nc;
byte[] arrReturn = client.UploadFile(addy, filePath);
Console.WriteLine(arrReturn.ToString());
}
この例外の理由は何でしょうか?