내가 FTP 서버에 파일을 업로드하기 위해 노력하고있어, 나는이 코드를 사용하고 있습니다 지원됩니다 :업로드 콘텐츠는 'http'와 'https'제도가
Uri uri;
if (!Uri.TryCreate(serverAddressField.Text.Trim(), UriKind.Absolute, out uri))
{
rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
return;
}
// Verify that we are currently not snapped, or that we can unsnap to open the picker.
if (ApplicationView.Value == ApplicationViewState.Snapped && !ApplicationView.TryUnsnap())
{
rootPage.NotifyUser("File picker cannot be opened in snapped mode. Please unsnap first.", NotifyType.ErrorMessage);
return;
}
FileOpenPicker picker = new FileOpenPicker();
picker.FileTypeFilter.Add("*");
StorageFile file = await picker.PickSingleFileAsync();
if (file == null)
{
rootPage.NotifyUser("No file selected.", NotifyType.ErrorMessage);
return;
}
PasswordCredential pw = new PasswordCredential();
pw.Password = "pass";
pw.UserName = "username";
BackgroundUploader uploader = new BackgroundUploader();
uploader.ServerCredential = pw;
uploader.Method = "POST";
uploader.SetRequestHeader("Filename", file.Name);
UploadOperation upload = uploader.CreateUpload(uri, file);
Log(String.Format("Uploading {0} to {1}, {2}", file.Name, uri.AbsoluteUri, upload.Guid));
// Attach progress and completion handlers.
await HandleUploadAsync(upload, true);
를하지만 나에게이 예외를 전송 여기 : UploadOperation upload = uploader.CreateUpload (uri, file); "Microsoft.Samples.Networking.BackgroundTransfer.exe에서 'System.ArgumentException'유형의 예외가 발생했지만 사용자 코드에서 처리되지 않았습니다.
WinRT 정보 : 'uri': 콘텐츠 업로드는 'http'및 'https'계획. "
그래서 무엇을해야 나는한다? –
응용 프로그램이 실행되는 동안 일반 FTP 업로드를 수행하거나 업로드를 허용하고 FTP 서버에 푸시하는 HTTP 서버를 작성할 수 있습니다. 백그라운드 FTP 업로드를 할 방법이 없습니다. –
안녕하세요 스테판, 회신 해 주셔서 감사합니다!이 목적에 대해 정말 아무것도 찾을 수 없기 때문에 당신이 내게 예제 또는 tuto 줄 수 있습니까? 감사합니다 :) –