﻿
{"id":7132,"date":"2018-03-18T04:44:13","date_gmt":"2018-03-18T04:44:13","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=7132"},"modified":"2018-03-18T04:44:52","modified_gmt":"2018-03-18T04:44:52","slug":"c-ile-ftp-protokolunu-kullanarak-serverdan-dosya-silme","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/c-ile-ftp-protokolunu-kullanarak-serverdan-dosya-silme\/","title":{"rendered":"C# \u0130le FTP Protokol\u00fcn\u00fc Kullanarak Server&#8217;dan Dosya Silme"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>\u00d6nceki yaz\u0131lar\u0131mdan olan <a href=\"http:\/\/www.gencayyildiz.com\/blog\/c-ile-ftpye-baglanma-ve-dosya-transferi\/\" rel=\"noopener\" target=\"_blank\">C# \u0130le FTP\u2019ye Ba\u011flanma ve Dosya Transferi<\/a> ba\u015fl\u0131kl\u0131 yaz\u0131mda sunucuya FTP \u00fczerinden herhangi bir dosyan\u0131n nas\u0131l at\u0131ld\u0131\u011f\u0131na de\u011finmi\u015ftik. \u015eimdi ise sunucuda bulunan herhangi bir dosyan\u0131n FTP \u00fczerinden C# ile nas\u0131l silinece\u011fini inceliyor olaca\u011f\u0131z.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    class FTPSunucuIslemleri\r\n    {\r\n        public static void DeleteFtpFile(string Server, string KlasorAdi, string DosyaAdi, string KullaniciAdi, string Sifre)\r\n        {\r\n\r\n            try\r\n            {\r\n                FtpWebRequest request = (FtpWebRequest)WebRequest.Create($&quot;ftp:\/\/{Server}\/{KlasorAdi}\/{DosyaAdi}&quot;);\r\n                request.Method = WebRequestMethods.Ftp.DeleteFile;\r\n                request.Credentials = new NetworkCredential(KullaniciAdi, Sifre);\r\n\r\n                FtpWebResponse response = (FtpWebResponse)request.GetResponse();\r\n            }\r\n            catch\r\n            {\r\n                throw;\r\n            }\r\n        }\r\n    }\r\n<\/pre>\n<p>Yukar\u0131da olu\u015fturmu\u015f oldu\u011fum &#8220;FTPSunucuIslemleri&#8221; isimli s\u0131n\u0131f i\u00e7erisindeki static &#8220;DeleteFtpFile&#8221; metodu sayesinde istedi\u011fimiz serverdan istedi\u011fimiz dosyay\u0131 g\u00f6n\u00fcl rahatl\u0131\u011f\u0131yla silebilmekteyiz.<\/p>\n<p>Bu s\u0131n\u0131f\u0131 kullan\u0131rken belirtilecek olan hedef dosyay\u0131 dikkatli bir \u015fekilde parametrize etmeniz gerekmektedir. Aksi taktirde olas\u0131 yanl\u0131\u015f hedef belirlemelerde ilgili dosya geri d\u00f6n\u00fc\u015f\u00fc m\u00fcmk\u00fcn olmamak \u00fczere silinecektir.<\/p>\n<p>Sonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, \u00d6nceki yaz\u0131lar\u0131mdan olan C# \u0130le FTP\u2019ye Ba\u011flanma ve Dosya Transferi ba\u015fl\u0131kl\u0131 yaz\u0131mda sunucuya FTP \u00fczerinden herhangi bir dosyan\u0131n nas\u0131l at\u0131ld\u0131\u011f\u0131na de\u011finmi\u015ftik. \u015eimdi ise sunucuda bulunan herhangi bir dosyan\u0131n FTP \u00fczerinden C# ile nas\u0131l&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":3223,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[2101,2103,2100,2102],"class_list":["post-7132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-sharp-c","tag-c-ftp-dosya-silme","tag-c-ftp-file-delete","tag-ftp-dosya-silme","tag-ftp-file-delete"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/7132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=7132"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/7132\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/3223"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=7132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=7132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=7132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}