{"id":929,"date":"2014-03-10T17:16:56","date_gmt":"2014-03-10T17:16:56","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=929"},"modified":"2022-02-17T06:24:03","modified_gmt":"2022-02-17T06:24:03","slug":"ftp-file-download","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/tcp-ip\/ftp-file-download","title":{"rendered":"FTP File Download"},"content":{"rendered":"<h4>\nSimple FTP File Download<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nusing namespace System::IO;\t\t\t\/\/Used for FTP\r\nusing namespace System::Net;\t\t\/\/Used for FTP\r\n\r\n\r\n\tarray&lt;Byte&gt;^FtpFileData;\r\n\r\n\tWebClient^ request = gcnew WebClient;\r\n\r\n\trequest-&gt;Credentials = gcnew NetworkCredential(&quot;MyUsername&quot;,&quot;MyPassword&quot;);\r\n\ttry\r\n\t{\r\n\t\tFtpFileData= request-&gt;DownloadData(&quot;ftp:\/\/1.2.3.4\/SomeDirectory\/MyFile.csv&quot;);\r\n\t}\r\n\tcatch (WebException^ e)\r\n\t{\r\n\t\tFtpFileData= gcnew array&lt;Byte&gt;(0);\r\n\t}\r\n\r\n\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple FTP File Download using namespace System::IO; \/\/Used for FTP using namespace System::Net; \/\/Used for FTP array&lt;Byte&gt;^FtpFileData; WebClient^ request = gcnew WebClient; request-&gt;Credentials = gcnew NetworkCredential(&quot;MyUsername&quot;,&quot;MyPassword&quot;); try { FtpFileData= request-&gt;DownloadData(&quot;ftp:\/\/1.2.3.4\/SomeDirectory\/MyFile.csv&quot;); } catch (WebException^ e) { FtpFileData= gcnew array&lt;Byte&gt;(0); } &nbsp; &nbsp; &nbsp;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-929","post","type-post","status-publish","format-standard","hentry","category-tcp-ip"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=929"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/929\/revisions"}],"predecessor-version":[{"id":932,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/929\/revisions\/932"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}