일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
- 경기도 버스
- eventargs
- TDD
- c#
- 버스 API
- WPF
- MDB Select
- sqlite3
- C# 파일 암/복호화
- Json.NET
- JSON
- Cell Border Style
- C# MDB
- 디자인 패턴
- 공공 데이터 포털
- 객체지향
- DrawRectangle
- 시
- 경기도 버스정보시스템
- MVC
- GDI+
- delegate
- NUnit
- MDB Connect
- Winform
- DrawEllipse
- eventhandler
- Excel Cell Format
- solid
- C# MDB Handle
- Today
- Total
White Whale Studio
[C#/WPF] FTP - DeleteFile / 파일 삭제 본문
해당 포스팅에서는
FTP 서버에 있는 파일을 삭제하는 방법을 살펴볼겁니다..
소스는 다음과 같습니다.
겁나 간단합니다.
public bool DeleteFiles(string filename)
{
try
{
string URI = server + "/" + filename; // 서버와, 파일명이 조합된 URL을 넘기고
System.Net.FtpWebRequest ftp = GetRequest(URI);
ftp.Method = System.Net.WebRequestMethods.Ftp.DeleteFile; // Method를 파일 삭제로 변경하고
FtpWebResponse response = (FtpWebResponse)ftp.GetResponse(); // Response 호출!!
Console.WriteLine("Delete status : {0}", response.StatusDescription);
response.Close(); // Response를 닫아줍니다.
return true;
}
catch (Exception ee)
{
return false;
}
}
'IT Engineering > .Net (WPF)' 카테고리의 다른 글
[WPF] UI 설정시 Dispatcher를 사용한 우선순위 강제로 설정 (0) | 2016.01.13 |
---|---|
[C#/WPF] FTP - 서버 상의 파일 사이즈 검색 GetFileSize (0) | 2015.04.27 |
[C#/WPF] 프로그램 시작 경로, 폴더 내 파일 정보 가져오기 (0) | 2015.04.16 |
[C#/WPF] FTP - Upload Files(파일 업로드) (0) | 2015.04.02 |
[C#/WPF] FTP - DownLoad Files / 파일 다운로드 (0) | 2015.04.02 |