[No0000DB]C# FtpClientHelper Ftp客戶端上傳下載重命名 類封裝

using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using Shared;namespace Helpers
{public static class FileHelper{#region  Methods/// <summary>///     向文本文件的尾部追加內容/// </summary>/// <param name="filePath"></param>/// <param name="content">寫入的內容</param>public static void AppendText(string filePath, string content){File.AppendAllText(filePath, content);}/// <summary>///     清空指定目錄下所有文件及子目錄,但該目錄依然保存./// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>public static void ClearDirectory(string directoryPath){if (IsExistDirectory(directoryPath)){//刪除目錄中所有的文件var filePaths = GetFileNames(directoryPath);foreach (var filePath in filePaths)DeleteFile(filePath);//刪除目錄中所有的子目錄var directoryPaths = GetDirectories(directoryPath);foreach (var oneDirectoryPath in directoryPaths)DeleteDirectory(oneDirectoryPath);}}/// <summary>///     清空文件內容/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static void ClearFile(string filePath){//刪除文件
            File.Delete(filePath);//重新創建該文件
            CreateFile(filePath);}/// <summary>///     檢測指定目錄中是否存在指定的文件,若要搜索子目錄請使用重載方法./// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>/// <param name="searchPattern">///     模式字符串,"*"代表0或N個字符,"?"代表1個字符。///     范例:"Log*.xml"表示搜索所有以Log開頭的Xml文件。/// </param>public static bool Contains(string directoryPath, string searchPattern){try{//獲取指定的文件列表var fileNames = GetFileNames(directoryPath, searchPattern, false);//判斷指定文件是否存在return fileNames.Length != 0;}catch (Exception exception){LogHelper.LogError("Error! ", exception);return false;}}/// <summary>///     檢測指定目錄中是否存在指定的文件/// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>/// <param name="searchPattern">///     模式字符串,"*"代表0或N個字符,"?"代表1個字符。///     范例:"Log*.xml"表示搜索所有以Log開頭的Xml文件。/// </param>/// <param name="isSearchChild">是否搜索子目錄</param>public static bool Contains(string directoryPath, string searchPattern, bool isSearchChild){try{//獲取指定的文件列表var fileNames = GetFileNames(directoryPath, searchPattern, true);//判斷指定文件是否存在return fileNames.Length != 0;}catch (Exception exception){LogHelper.LogError("Error! ", exception);return false;}}/// <summary>///     將源文件的內容復制到目標文件中/// </summary>/// <param name="sourceFilePath">源文件的絕對路徑</param>/// <param name="destFilePath">目標文件的絕對路徑</param>public static void Copy(string sourceFilePath, string destFilePath){File.Copy(sourceFilePath, destFilePath, true);}/// <summary>///     將一個目錄的文件拷貝到另外一個目錄去/// </summary>/// <param name="srcPath">源目錄</param>/// <param name="aimPath">目標目錄</param>/// <param name="flag">是否允許覆蓋同名文件</param>/// <param name="version">當出現多次調用此方法的時候,能夠重命名多次,比如xxx.1.old,xxx.2.old</param>public static void CopyDir(string srcPath, string aimPath, bool flag, int version){// 檢查目標目錄是否以目錄分割字符結束如果不是則添加之if (aimPath[aimPath.Length - 1] != Path.DirectorySeparatorChar)aimPath += Path.DirectorySeparatorChar;// 判斷目標目錄是否存在如果不存在則新建之
            CreateDirectory(aimPath);// 得到源目錄的文件列表,該里面是包含文件以及目錄路徑的一個數組// 如果你指向copy目標文件下面的文件而不包含目錄請使用下面的方法var fileList = Directory.GetFileSystemEntries(srcPath);// 遍歷所有的文件和目錄foreach (var file in fileList)try{// 如果這是一個目錄,并且不是update目錄,遞歸if (Directory.Exists(file)){var path = Path.GetDirectoryName(file);if (path != null){var dirName = path.Split('\\');if (dirName[dirName.Length - 1].ToLower() != "update")CopyDir(file, aimPath + Path.GetFileName(file), flag, version);}}// 否則直接Copy文件(不拷貝update.xml文件)else if (!file.ToLower().Contains("update.xml")){//如果是pdb文件,直接忽略if (file.Contains(".pdb") || file.Contains(".vshost.exe"))continue;//如果文件是dll或者exe文件,則可能是正在使用的文件,不能直接替換if (file.ToLower().Contains(".exe") || file.ToLower().Contains(".dll") ||file.ToLower().Contains(".pdb")){var exist = false;//正在使用的文件將不能拷貝var onUsedFiles = AppDomain.CurrentDomain.GetAssemblies();foreach (var onUsedFile in onUsedFiles){var filename = onUsedFile.ManifestModule.Name;//正在使用的文件if (file.Contains(filename)){//先判斷這個文件存在if (Contains(aimPath, Path.GetFileName(file)))File.Move(aimPath + Path.GetFileName(file),aimPath + Path.GetFileName(file) + "." + version + ".old");File.Copy(file, aimPath + Path.GetFileName(file), true);exist = true;break;}}//不是依賴項并且本身不是更新程序本身if (!exist)File.Copy(file, aimPath + Path.GetFileName(file), true);//更新程序自身的更新(單獨調試此工程的時候需要用到這一段)/*if (Path.GetFileName(file) == "EastMoney.BPF.DataPlatformUpgrade.exe"){try{File.Move(aimPath + Path.GetFileName(file),aimPath + Path.GetFileName(file) + "." + version + ".old");File.Copy(file, aimPath + Path.GetFileName(file), true);}catch (Exception exception){LogHelper.LogError("Error! ", exception);}}*/}else{File.Copy(file, aimPath + Path.GetFileName(file), true);}}}catch (Exception exception){LogHelper.LogError("拷貝文件失敗,失敗原因為:" + exception.Message + " 文件名為:" + file, exception);}}/// <summary>///     創建一個目錄/// </summary>/// <param name="directoryPath">目錄的絕對路徑</param>public static void CreateDirectory(string directoryPath){//如果目錄不存在則創建該目錄if (!IsExistDirectory(directoryPath))Directory.CreateDirectory(directoryPath);}/// <summary>///     創建一個文件。/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static bool CreateFile(string filePath){try{//如果文件不存在則創建該文件if (!IsExistFile(filePath)){var fileInfo = new FileInfo(filePath); //創建一個FileInfo對象var fileStream = fileInfo.Create(); //創建文件fileStream.Close(); //關閉文件流
                }}catch (Exception exception){LogHelper.LogError("Error! ", exception);return false;}return true;}/// <summary>///     創建一個文件,并將字節流寫入文件。/// </summary>/// <param name="filePath">文件的絕對路徑</param>/// <param name="buffer">二進制流數據</param>public static bool CreateFile(string filePath, byte[] buffer){try{//如果文件不存在則創建該文件if (!IsExistFile(filePath)){//創建一個FileInfo對象var file = new FileInfo(filePath);//創建文件var fs = file.Create();//寫入二進制流fs.Write(buffer, 0, buffer.Length);//關閉文件流
                    fs.Close();}}catch (Exception exception){LogHelper.LogError("Error! ", exception);return false;}return true;}/// <summary>///     刪除指定目錄及其所有子目錄(打開狀態下降不能刪除)/// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>public static void DeleteDirectory(string directoryPath){if (IsExistDirectory(directoryPath))try{Directory.Delete(directoryPath, true);}catch (Exception exception){LogHelper.LogError("刪除出錯,可能是因為文件夾被打開了!請關閉后再試!路徑為" + directoryPath + exception.Message, exception);}}/// <summary>/// 調用bat刪除目錄,以防止系統底層的異步刪除機制/// </summary>/// <param name="dirPath"></param>/// <returns></returns>public static bool DeleteDirectoryWithCmd(string dirPath){var process = new Process(); //string path = ...;//bat路徑  var processStartInfo = new ProcessStartInfo("CMD.EXE", "/C rd /S /Q \"" + dirPath + "\""){UseShellExecute = false,RedirectStandardOutput = true}; //第二個參數為傳入的參數,string類型以空格分隔各個參數  process.StartInfo = processStartInfo;process.Start();process.WaitForExit();var output = process.StandardOutput.ReadToEnd();if (string.IsNullOrWhiteSpace(output))return true;return false;}/// <summary>/// 調用bat刪除文件,以防止系統底層的異步刪除機制/// </summary>/// <param name="filePath"></param>/// <returns></returns>public static bool DelFileWithCmd(string filePath){var process = new Process(); //string path = ...;//bat路徑  var processStartInfo = new ProcessStartInfo("CMD.EXE", "/C del /F /S /Q \"" + filePath + "\""){UseShellExecute = false,RedirectStandardOutput = true}; //第二個參數為傳入的參數,string類型以空格分隔各個參數  process.StartInfo = processStartInfo;process.Start();process.WaitForExit();var output = process.StandardOutput.ReadToEnd();if (output.Contains(filePath))return true;return false;}/// <summary>///     刪除指定文件/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static void DeleteFile(string filePath){if (IsExistFile(filePath))File.Delete(filePath);}/// <summary>///     通過后綴名在目錄中查找文件/// </summary>/// <param name="directory">目錄</param>/// <param name="pattern">后綴名</param>public static void DeleteFiles(DirectoryInfo directory, string pattern){if (directory.Exists && pattern.Trim() != string.Empty){try{foreach (var fileInfo in directory.GetFiles(pattern))fileInfo.Delete();}catch (Exception exception){LogHelper.LogError("Error! ", exception);}foreach (var info in directory.GetDirectories())DeleteFiles(info, pattern);}}/// <summary>///     將文件讀取到緩沖區中/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static byte[] FileToBytes(string filePath){//獲取文件的大小 var fileSize = GetFileSize(filePath);//創建一個臨時緩沖區var buffer = new byte[fileSize];//創建一個文件流var fileInfo = new FileInfo(filePath);var fileStream = fileInfo.Open(FileMode.Open);try{//將文件流讀入緩沖區fileStream.Read(buffer, 0, fileSize);return buffer;}catch (Exception exception){LogHelper.LogError("Error! ", exception);return null;}finally{fileStream.Close(); //關閉文件流
            }}/// <summary>///     將文件讀取到字符串中/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static string FileToString(string filePath){return FileToString(filePath, Encoding.Default);}/// <summary>///     將文件讀取到字符串中/// </summary>/// <param name="filePath">文件的絕對路徑</param>/// <param name="encoding">字符編碼</param>public static string FileToString(string filePath, Encoding encoding){//創建流讀取器var reader = new StreamReader(filePath, encoding);try{return reader.ReadToEnd(); //讀取流
            }catch{return string.Empty;}finally{reader.Close(); //關閉流讀取器
            }}/// <summary>///     獲取指定目錄中所有子目錄列表,若要搜索嵌套的子目錄列表,請使用重載方法./// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>public static string[] GetDirectories(string directoryPath){try{return Directory.GetDirectories(directoryPath);}catch (Exception exception){LogHelper.LogError("Error! ", exception);return null;}}/// <summary>///     獲取指定目錄及子目錄中所有子目錄列表/// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>/// <param name="searchPattern">///     模式字符串,"*"代表0或N個字符,"?"代表1個字符。///     范例:"Log*.xml"表示搜索所有以Log開頭的Xml文件。/// </param>/// <param name="isSearchChild">是否搜索子目錄</param>public static string[] GetDirectories(string directoryPath, string searchPattern, bool isSearchChild){try{return Directory.GetDirectories(directoryPath, searchPattern,isSearchChild ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);}catch (Exception exception){LogHelper.LogError("Error! ", exception);return null;}}/// <summary>///     從文件的絕對路徑中獲取擴展名/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static string GetExtension(string filePath){var fileInfo = new FileInfo(filePath); //獲取文件的名稱return fileInfo.Extension;}/// <summary>///     從文件的絕對路徑中獲取文件名( 包含擴展名 )/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static string GetFileName(string filePath){//獲取文件的名稱var fileInfo = new FileInfo(filePath);return fileInfo.Name;}/// <summary>///     從文件的絕對路徑中獲取文件名( 不包含擴展名 )/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static string GetFileNameNoExtension(string filePath){//獲取文件的名稱var fileInfo = new FileInfo(filePath);return fileInfo.Name.Split('.')[0];}/// <summary>///     獲取指定目錄中所有文件列表/// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>public static string[] GetFileNames(string directoryPath){if (!IsExistDirectory(directoryPath)) //如果目錄不存在,則拋出異常throw new FileNotFoundException();return Directory.GetFiles(directoryPath); //獲取文件列表
        }/// <summary>///     獲取指定目錄及子目錄中所有文件列表/// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>/// <param name="searchPattern">///     模式字符串,"*"代表0或N個字符,"?"代表1個字符。///     范例:"Log*.xml"表示搜索所有以Log開頭的Xml文件。/// </param>/// <param name="isSearchChild">是否搜索子目錄</param>public static string[] GetFileNames(string directoryPath, string searchPattern, bool isSearchChild){if (!IsExistDirectory(directoryPath)) //如果目錄不存在,則拋出異常throw new FileNotFoundException();try{return Directory.GetFiles(directoryPath, searchPattern,isSearchChild ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);}catch (Exception exception){LogHelper.LogError("Error! ", exception);return null;}}/// <summary>///     獲取一個文件的長度,單位為Byte/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static int GetFileSize(string filePath){//創建一個文件對象var fileInfo = new FileInfo(filePath);//獲取文件的大小return (int) fileInfo.Length;}/// <summary>///     獲取一個文件的長度,單位為KB/// </summary>/// <param name="filePath">文件的路徑</param>public static double GetFileSizeByKB(string filePath){var fileInfo = new FileInfo(filePath); //創建一個文件對象var size = fileInfo.Length / 1024;return double.Parse(size.ToString()); //獲取文件的大小
        }/// <summary>///     獲取一個文件的長度,單位為MB/// </summary>/// <param name="filePath">文件的路徑</param>public static double GetFileSizeByMB(string filePath){var fileInfo = new FileInfo(filePath); //創建一個文件對象var size = fileInfo.Length / 1024 / 1024;return double.Parse(size.ToString()); //獲取文件的大小
        }/// <summary>///     得到文件大小/// </summary>/// <param name="filePath"></param>/// <returns></returns>public static long GetFileSizeFromPath(string filePath = null){if (string.IsNullOrEmpty(filePath)) return -1;if (!File.Exists(filePath)) return -1;var objFile = new FileInfo(filePath);return objFile.Length;}/// <summary>///     獲取文本文件的行數/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static int GetLineCount(string filePath){//將文本文件的各行讀到一個字符串數組中var rows = File.ReadAllLines(filePath);//返回行數return rows.Length;}/// <summary>///     檢測指定目錄是否為空/// </summary>/// <param name="directoryPath">指定目錄的絕對路徑</param>public static bool IsEmptyDirectory(string directoryPath){try{//判斷是否存在文件var fileNames = GetFileNames(directoryPath);if (fileNames.Length > 0)return false;//判斷是否存在文件夾var directoryNames = GetDirectories(directoryPath);return directoryNames.Length <= 0;}catch{return false;}}/// <summary>///     檢測指定目錄是否存在/// </summary>/// <param name="directoryPath">目錄的絕對路徑</param>public static bool IsExistDirectory(string directoryPath){return Directory.Exists(directoryPath);}/// <summary>///     檢測指定文件是否存在,如果存在則返回true。/// </summary>/// <param name="filePath">文件的絕對路徑</param>public static bool IsExistFile(string filePath){return File.Exists(filePath);}/// <summary>///     將文件移動到指定目錄/// </summary>/// <param name="sourceFilePath">需要移動的源文件的絕對路徑</param>/// <param name="descDirectoryPath">移動到的目錄的絕對路徑</param>public static void Move(string sourceFilePath, string descDirectoryPath){//獲取源文件的名稱var sourceFileName = GetFileName(sourceFilePath);if (IsExistDirectory(descDirectoryPath)){//如果目標中存在同名文件,則刪除if (IsExistFile(descDirectoryPath + "\\" + sourceFileName))DeleteFile(descDirectoryPath + "\\" + sourceFileName);//將文件移動到指定目錄File.Move(sourceFilePath, descDirectoryPath + "\\" + sourceFileName);}}/// <summary>///     將流讀取到緩沖區中/// </summary>/// <param name="stream">原始流</param>public static byte[] StreamToBytes(Stream stream){try{//創建緩沖區var buffer = new byte[stream.Length];//讀取流stream.Read(buffer, 0, int.Parse(stream.Length.ToString()));//返回流return buffer;}catch (Exception exception){LogHelper.LogError("Error! ", exception);return null;}finally{stream.Close(); //關閉流
            }}/// <summary>///     向文本文件中寫入內容,默認UTF8編碼/// </summary>/// <param name="filePath">文件的絕對路徑</param>/// <param name="content">寫入的內容</param>/// <param name="encoding"></param>public static void WriteText(string filePath, string content, Encoding encoding = null){if (encoding == null){encoding = Encoding.UTF8;}File.WriteAllText(filePath, content, encoding); //向文件寫入內容
        }#endregion/// <summary>   /// 重命名文件夾內的所有子文件夾   ============================/// </summary>   /// <param name="directoryName">文件夾名稱</param>   /// <param name="newDirectoryName">新子文件夾名稱格式字符串</param>   public static bool RenameDirectories(string directoryName, string newDirectoryName){DirectoryInfo directoryInfo = new DirectoryInfo(directoryName);if (!directoryInfo.Exists){return false;}try{int i = 1;//string[] sDirectories = Directory.GetDirectories(directoryName);foreach (var sDirectory in directoryInfo.GetDirectories()){string sNewDirectoryName = string.Format(newDirectoryName, i++);string sNewDirectory = Path.Combine(directoryName, sNewDirectoryName);sDirectory.MoveTo(sNewDirectory);// Directory.Move(sDirectory, sNewDirectory);
                }return true;}catch (Exception exception){LogHelper.LogError("Error! ", exception);return false;}}/// <summary>/// 文件重命名/// </summary>/// <param name="oldFileName"></param>/// <param name="newFileName"></param>public static bool FileRename(string filePath, string newFileName){FileInfo fileInfo = new FileInfo(filePath); // 列表中的原始文件全路徑名if (!fileInfo.Exists){return false;}// fileInfo.DirectoryName // fileInfo.MoveTo(Path.Combine(newStr));// 改名方法return true;// 新文件名
        }}
}

?

轉載于:https://www.cnblogs.com/Chary/p/No0000DB.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/283910.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/283910.shtml
英文地址,請注明出處:http://en.pswp.cn/news/283910.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

WPF效果第一百九十四篇之伸縮面板

前面一篇玩耍了一下登錄實現效果;今天在原來的基礎上來玩耍一下伸縮面板的效果;閑話不多扯直接看效果:1、關于前臺簡單布局:2、左側面板伸縮動畫&#xff1a;<Storyboard x:Key"ShowConfigSb"><ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty…

你不知道的JavaScript(二)

第三章 原生函數 JS有很多原生函數&#xff0c;為基本的數據類型值提供了封裝對象&#xff0c;String&#xff0c;Number&#xff0c;Boolean等。我們可以通過{}.call.toString()來查看所有typeof返回object的對象的內置屬性[[class]],這個屬性無法直接訪問。我們基本類型調用的…

[轉]guava快速入門

Guava工程包含了若干被Google的 Java項目廣泛依賴 的核心庫&#xff0c;例如&#xff1a;集合 [collections] 、緩存 [caching] 、原生類型支持 [primitives support] 、并發庫 [concurrency libraries] 、通用注解 [common annotations] 、字符串處理 [string processing] 、I…

數據庫編程1 Oracle 過濾 函數 分組 外連接 自連接

【本文謝絕轉載原文來自http://990487026.blog.51cto.com】<大綱>數據庫編程1 Oracle 過濾 函數 分組 外連接 自連接本文實驗基于的數據表:winsows安裝好Oracle11g之后,開始實驗SQLplus 登陸 ORaclesqlplus 退出的方式查看用戶之下有什么表查看表的所有記錄&#xff0c;不…

【.NET 6】開發minimal api以及依賴注入的實現和代碼演示

前言&#xff1a;.net 6 LTS版本發布已經有一段時間了。此處做一個關于使用.net 6 開發精簡版webapi&#xff08;minimal api&#xff09;的入門教程演示。1、新建一個項目。此處就命名為 SomeExample:2、選擇 .net6版本&#xff0c;并且此處先去掉HTTPS配置以及去掉使用控制器…

(轉載)VS2010/MFC編程入門之四(MFC應用程序框架分析)

上一講雞啄米講的是VS2010應用程序工程中文件的組成結構&#xff0c;可能大家對工程的運行原理還是很模糊&#xff0c;理不出頭緒&#xff0c;畢竟跟C編程入門系列中的例程差別太大。這一節雞啄米就為大家分析下MFC應用程序框架的運行流程。 一.SDK應用程序與MFC應用程序運行過…

個人博客開發-開篇

邁出第一步&#xff1a; 很久以前就有這個想法&#xff0c;自己動手開發一套個人博客系統&#xff0c;終于&#xff0c;現在開始邁出了第一步。做這件事一點是做一個有個人風格的博客系統&#xff0c;第二點是對做這件事所使用的技術棧進行學習&#xff0c;所謂最好的學習就是實…

2022年中國中小學教育信息化行業研究報告

教育信息化丨研究報告 核心摘要&#xff1a; 背景篇 目前&#xff0c;我國中小學教育主要呈現信息時代教育的特征&#xff0c;智能時代教育特征初露端倪&#xff1b;中小學教育信息化正從量變邁向質變&#xff0c;創新引領與生態變革成為行業縱深的主旋律&#xff1b; 2021年…

使用curl指令發起websocket請求

昨日的文章沒指出websocket請求協商切換的精髓&#xff0c;刪除重發。前文相關&#xff1a;? .NET WebSockets 核心原理初體驗[1]? SignalR 從開發到生產部署避坑指南[2]tag&#xff1a;瀏覽器--->nginx--> server其中提到nginx默認不會為客戶端轉發Upgrade、Connectio…

Yii 2 的安裝 之 踩坑歷程

由于剛接觸yii2 ,決定先裝個試試&#xff1b;可是這一路安裝差點整吐血&#xff0c;可能還是水平有限吧&#xff0c; 但還是想把這個過程分享出來&#xff0c;讓遇到同樣問題的同學有個小小的參考&#xff0c;好了言歸正傳&#xff01;&#xff01; <(~.~)> 下面是安裝流…

設計模式之代理模式(上) 靜態代理與JDK動態代理

2019獨角獸企業重金招聘Python工程師標準>>> 代理模式 給某一個對象提供一個代理&#xff0c;并由代理對象控制對原對象的引用。靜態代理 靜態代理是由我們編寫好的類&#xff0c;在程序運行之前就已經編譯好的的類&#xff0c;此時就叫靜態代理。 說理論還是比較懵…

mysql 分頁查詢

使用limit函數 limit關鍵字的用法&#xff1a; LIMIT [offset,] rows offset指定要返回的第一行的偏移量&#xff0c;rows第二個指定返回行的最大數目。初始行的偏移量是0(不是1)。轉載于:https://www.cnblogs.com/xping/p/6703986.html

WPF 實現更換主題色

WPF 實現更換主題色WPF 使用 WPFDevelopers.Minimal 如何更換主題色作者&#xff1a;WPFDevelopersOrg原文鏈接&#xff1a; https://github.com/WPFDevelopersOrg/WPFDevelopers.Minimal框架使用大于等于.NET40&#xff1b;Visual Studio 2022;項目使用 MIT 開源許可協議&a…

vue3與vue2的區別

先來說說當下市場開發使用的問題&#xff0c;目前2021年使用vue3開發的企業還是少&#xff0c;基本上都還是以vue2的形式進行開發&#xff0c;vue3的開發模式跟react很像&#xff0c;這時候有人就會想那我學vue3有用么&#xff0c;淦&#xff0c;他喵的&#xff0c;先別激動&am…

Spring Data REST API集成Springfox、Swagger

原文: Documenting a Spring Data REST API with Springfox and Swagger 使用Spring Date REST&#xff0c;你可以迅速為Spring Date repositories的創建REST API&#xff0c;并提供CRUD和更多功能。然而&#xff0c;在嚴謹的API開發過成功&#xff0c;您還希望擁有自動生成的最…

【系統設計】S3 對象存儲

在本文中&#xff0c;我們設計了一個類似于 Amazon Simple Storage Service (S3) 的對象存儲服務。S3 是 Amazon Web Services (AWS) 提供的一項服務&#xff0c; 它通過基于 RESTful API 的接口提供對象存儲。根據亞馬遜的報告&#xff0c;到 2021 年&#xff0c;有超過 100 萬…

轉: telnet命令學習

1.每天一個linux命令&#xff08;58&#xff09;&#xff1a;telnet命令 轉自&#xff1a; http://www.cnblogs.com/peida/archive/2013/03/13/2956992.html telnet命令通常用來遠程登錄。telnet程序是基于TELNET協議的遠程登錄客戶端程序。Telnet協議是TCP/IP協議族中的一員&a…

禪道、碼云、coding、redmine、jira、teambition幾大敏捷開發項目管理系統試用對比體驗

作為一個軟件公司的管理人員&#xff0c;在項目和人員多起來后&#xff0c;就需要通過系統來對項目和人員進行管理。 我們是典型的軟件外包公司&#xff0c;專為客戶定制軟件&#xff0c;所以我們的業務都是項目型的。因此&#xff0c;在管理模式上&#xff0c;我們就要用所謂…

Dubbo中的SPI機制

Dubbo中的SPI機制 概述 Service Provider Interface 即 SPI&#xff0c;是JDK內置的一種服務提供發現機制&#xff0c;可以用來啟用框架擴展和替換組件。可以讓不同的廠商針對統一接口編寫不同的實現 SPI實際上是“接口策略模式配置文件”實現的動態加載機制。在系統設計中&…