안녕하세요,
일단이 오류가 발생하지 않도록이 코드를 다운로드하고 파일을 다운로드했습니다.
이제 권한 오류가 발생합니다.
acesscontrol 팝업 창이 나타나지 않습니다.
어쨌든
어떻게 파일을 다운로드 할 수 있습니까?파일 권한 (쓰기)
WebClient request = new WebClient();
request.Credentials = new NetworkCredential(txtFTPuser.Text, txtFTPpassword.Text);
byte[] fileData = request.DownloadData(fullDownloaPath);//dnoces.dreamhost.com
FileSecurity security = File.GetAccessControl(downloadTo);
FileSystemAccessRule rule = new FileSystemAccessRule(@"BUILTIN\Users",
FileSystemRights.FullControl, AccessControlType.Allow);
File.SetAccessControl(downloadTo, security);
try
{
FileStream f = File.Create(downloadTo/*[email protected]"\"+file*/);
f.Write(fileData, 0, fileData.Length);
f.Close();
MessageBox.Show("Completed!");
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}
응용 프로그램을 관리자로 실행하십시오. –
WinForms 또는 ASP.NET? –
여전히 내게 동일한 오류가 발생합니다 ... "경로에 대한 액세스가 거부되었습니다. ... 거부되었습니다. "(& ShadowWizard, WinForms의 경우) – funerr