質問編集履歴
1
掲載ソースの誤記を修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -39,18 +39,19 @@
|
|
39
39
|
. {
|
40
40
|
. string uri = "";
|
41
41
|
. try {
|
42
|
-
.
|
42
|
+
. if (_cred == null) {
|
43
|
-
.
|
43
|
+
. _cred = new NetworkCredential(id, password);
|
44
|
-
. }
|
45
|
-
. using (WebClient webClient = new WebClient()) {
|
46
|
-
. webClient.Credentials = _cred;
|
47
|
-
. webClient.Proxy = null;
|
48
|
-
. for (int i = 0; i < fullFileNames.Length; i++) {
|
49
|
-
. uri = "ftp://" + url + "/";
|
50
|
-
. uri += serverDir + "/";
|
51
|
-
. uri += fileNames[i];
|
52
|
-
. webClient.UploadFile(uri, fullFileNames[i]);
|
53
44
|
. }
|
45
|
+
. using (WebClient webClient = new WebClient()) {
|
46
|
+
. webClient.Credentials = _cred;
|
47
|
+
. webClient.Proxy = null;
|
48
|
+
. for (int i = 0; i < fullFileNames.Length; i++) {
|
49
|
+
. uri = "ftp://" + url + "/";
|
50
|
+
. uri += serverDir + "/";
|
51
|
+
. uri += fileNames[i];
|
52
|
+
. webClient.UploadFile(uri, fullFileNames[i]);
|
53
|
+
. }
|
54
|
+
. }
|
54
55
|
. }
|
55
56
|
. catch(WebException webex) {
|
56
57
|
. throw;
|