{"id":1406,"date":"2014-11-22T15:33:31","date_gmt":"2014-11-22T07:33:31","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1406"},"modified":"2014-11-22T15:33:31","modified_gmt":"2014-11-22T07:33:31","slug":"vc-ftp%e4%b8%8a%e4%bc%a0%e6%96%87%e4%bb%b6%e4%be%8b%e5%ad%90%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1406","title":{"rendered":"vc-ftp\u4e0a\u4f20\u6587\u4ef6\u4f8b\u5b50\u6559\u7a0b"},"content":{"rendered":"
\u76f4\u63a5\u4e0a\u4ee3\u7801\u5427\uff1a<\/p>\n
\r\nvoid CftptestDlg::OnBnClickedButtonGo()\r\n{\r\n\t\/\/ TODO: \u5728\u6b64\u6dfb\u52a0\u63a7\u4ef6\u901a\u77e5\u5904\u7406\u7a0b\u5e8f\u4ee3\u7801\r\n\t\/\/\u5f00\u59cb\u4e0a\u4f20\r\n\tCInternetSession CIS;\r\n\tCFtpConnection *ftp = CIS.GetFtpConnection(\"server\",\"username\",\"ps\",21);\r\n\t\/\/\u5efa\u7acb\u6587\u4ef6\u5939\r\n\t\/\/ftp->CreateDirectory(\"fffff\");\r\n\tCString strLocalFile;\r\n\tCFile fUpload(\"test.zip\",CFile::modeRead|CFile::typeBinary);\r\n\t\/\/\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\u7684\u5927\u5c0f\r\n\tint nFileLength = fUpload.GetLength();\r\n\tfUpload.Read(strLocalFile.GetBuffer(nFileLength),nFileLength);\r\n\tstrLocalFile.ReleaseBuffer(nFileLength);\r\n\tfUpload.Close();\r\n\t\/\/\u8fdc\u7a0bftp\u6587\u4ef6\r\n\tCInternetFile *CIF = ftp->OpenFile(\"test.zip\",GENERIC_WRITE,FTP_TRANSFER_TYPE_BINARY,1);\r\n\tCIF->Write(strLocalFile.GetBuffer(nFileLength),nFileLength);\r\n\tCIF->Close();\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u76f4\u63a5\u4e0a\u4ee3\u7801\u5427\uff1a void CftptestDlg::OnBnClickedButtonGo() { \/\/ TODO: \u5728\u6b64\u6dfb\u52a0\u63a7\u4ef6\u901a\u77e5\u5904\u7406\u7a0b\u5e8f\u4ee3\u7801 \/\/\u5f00\u59cb\u4e0a\u4f20 CInternetSession CIS; CFtpConnection *ftp = CIS.GetFtpConnection(“server”,”username”,”ps”,21); \/\/\u5efa\u7acb\u6587\u4ef6\u5939 \/\/ftp->CreateDirectory(“fffff”); CString strLocalFile; CFile fUpload(“test.zip”,CFile::modeRead|CFile::typeBinary); <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,219,9],"tags":[250,144,251,200],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1406"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1406"}],"version-history":[{"count":1,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1406\/revisions"}],"predecessor-version":[{"id":1407,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1406\/revisions\/1407"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1406"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}