91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 0.07M
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-25
  • 語言: 其他
  • 標(biāo)簽: 其他??

資源簡(jiǎn)介

MyWatch.zip

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Configuration;
using?System.IO;
using?System.Linq;
using?System.Net;
using?System.Text;

namespace?MyWatch
{
????static?public?class?FtpHelper
????{
????????//基本設(shè)置
????????static?private?string?path?=?@“ftp://“?+?ConfigurationManager.AppSettings[“ServerIp“]?+?“/“;?//目標(biāo)路徑
????????static?private?string?ftpip?=?ConfigurationManager.AppSettings[“ServerIp“];?//ftp?IP地址
????????static?private?string?username?=?ConfigurationManager.AppSettings[“Username“];//ftp用戶名
????????static?private?string?password?=?ConfigurationManager.AppSettings[“Password“];//ftp密碼

????????//獲取ftp上面的文件和文件夾
????????public?static?string[]?GetFileList(string?dir)
????????{
????????????string[]?downloadFiles;
????????????StringBuilder?result?=?new?StringBuilder();
????????????FtpWebRequest?request;
????????????try
????????????{
????????????????request?=?(FtpWebRequest)FtpWebRequest.Create(new?Uri(path));
????????????????request.UseBinary?=?true;
????????????????request.Credentials?=?new?NetworkCredential(username?password);//設(shè)置用戶名和密碼
????????????????request.Method?=?WebRequestMethods.Ftp.ListDirectory;
????????????????request.UseBinary?=?true;

????????????????WebResponse?response?=?request.GetResponse();
????????????????StreamReader?reader?=?new?StreamReader(response.GetResponseStream());

????????????????string?line?=?reader.ReadLine();
????????????????while?(line?!=?null)
????????????????{
????????????????????result.Append(line);
????????????????????result.Append(“\n“);
????????????????????Console.WriteLine(line);
????????????????????line?=?reader.ReadLine();
????????????????}
????????????????//?to?remove?the?trailing?‘\n‘
????????????????result.Remove(result.ToString().LastIndexOf(‘\n‘)?1);
????????????????reader.Close();
????????????????response.Close();
????????????????return?result.ToString().Split(‘\n‘);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????Console.WriteLine(“獲取ftp上面的文件和文件夾:“?+?ex.Message);
????????????????downloadFiles?=?null;
????????????????return?downloadFiles;
????????????}
????????}

????????///?
????????///?獲取文件大小
????????///?

????????///?ip服務(wù)器下的相對(duì)路徑
????????///?文件大小
????????public?static?int?GetFileSize(string?file)
????????{
????????????StringBuilder?result?=?new?StringBuilder();
????????????FtpWebRequest?request;
????????????try
????????????{
????????????????request?=?(FtpWebRequest)FtpWebRequest.Create(new?Uri(path?+?file));
????????????????request.UseBinary?=?true;
????????????????request.Credentials?=?new?NetworkCredential(username?password);//設(shè)置用戶名和密碼
????????????????request.Method?=?WebRequestMethods.Ftp.GetFileSize;

????????????????int?dataLength?=?(int)request.GetResponse().ContentLength;

????????????????return?dataLength;
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????Console.Write

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-01-15?11:12??MyWatch\
?????目錄???????????0??2015-01-15?10:06??MyWatch\MyWatch\
?????文件????????1543??2015-01-15?11:13??MyWatch\MyWatch.sln
?????文件???????36352??2015-01-15?12:29??MyWatch\MyWatch.suo
?????文件?????????673??2015-01-15?12:21??MyWatch\MyWatch\App.config
?????目錄???????????0??2015-01-14?15:08??MyWatch\MyWatch\bin\
?????目錄???????????0??2015-01-15?11:38??MyWatch\MyWatch\bin\Debug\
?????文件???????18432??2015-01-15?11:37??MyWatch\MyWatch\bin\Debug\MyWatch.exe
?????文件?????????662??2015-01-15?11:38??MyWatch\MyWatch\bin\Debug\MyWatch.exe.Config
?????文件???????40448??2015-01-15?11:37??MyWatch\MyWatch\bin\Debug\MyWatch.pdb
?????文件???????11600??2015-01-15?11:38??MyWatch\MyWatch\bin\Debug\MyWatch.vshost.exe
?????文件?????????664??2015-01-15?11:35??MyWatch\MyWatch\bin\Debug\MyWatch.vshost.exe.config
?????目錄???????????0??2015-01-14?15:08??MyWatch\MyWatch\bin\Release\
?????文件???????11777??2015-01-15?10:39??MyWatch\MyWatch\FtpHelper.cs
?????文件????????7730??2015-01-15?12:27??MyWatch\MyWatch\MyForm.cs
?????文件????????9008??2015-01-15?11:18??MyWatch\MyWatch\MyForm.Designer.cs
?????文件????????5817??2015-01-15?11:18??MyWatch\MyWatch\MyForm.resx
?????文件????????3953??2015-01-15?10:07??MyWatch\MyWatch\MyWatch.csproj
?????目錄???????????0??2015-01-14?14:51??MyWatch\MyWatch\obj\
?????目錄???????????0??2015-01-14?14:51??MyWatch\MyWatch\obj\x86\
?????目錄???????????0??2015-01-15?11:37??MyWatch\MyWatch\obj\x86\Debug\
?????文件????????5359??2015-01-14?15:34??MyWatch\MyWatch\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6655??2015-01-15?11:37??MyWatch\MyWatch\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件?????????597??2015-01-15?11:38??MyWatch\MyWatch\obj\x86\Debug\MyWatch.csproj.FileListAbsolute.txt
?????文件?????????976??2015-01-15?11:28??MyWatch\MyWatch\obj\x86\Debug\MyWatch.csproj.GenerateResource.Cache
?????文件???????18432??2015-01-15?11:37??MyWatch\MyWatch\obj\x86\Debug\MyWatch.exe
?????文件?????????180??2015-01-15?11:28??MyWatch\MyWatch\obj\x86\Debug\MyWatch.MyForm.resources
?????文件???????40448??2015-01-15?11:37??MyWatch\MyWatch\obj\x86\Debug\MyWatch.pdb
?????文件?????????180??2015-01-15?10:20??MyWatch\MyWatch\obj\x86\Debug\MyWatch.Properties.Resources.resources
?????目錄???????????0??2015-01-15?10:08??MyWatch\MyWatch\obj\x86\Debug\TempPE\
?????文件?????????489??2015-01-14?14:56??MyWatch\MyWatch\Program.cs
............此處省略6個(gè)文件信息

評(píng)論

共有 條評(píng)論