本文实现了在C#中,知道文件的路径后,读取该文件内容,并转换为byte数组返回的方法。
源代码
1 | class FileHelper{ |
调用示例:
1 |
|
文本完
本文实现了在C#中,知道文件的路径后,读取该文件内容,并转换为byte数组返回的方法。
源代码
1 | class FileHelper{ |
调用示例:
1 |
|
文本完
扩展ObservableCollection,实现添加集合的扩展,当集合中新增、修改或者删除项目时,或者集合被刷新时,触发通知(通过实现接口INotifyCollectionChanged)。
1 | using System; |
使用RSACryptoServiceProvider加密和解密一个字符串。
1 | using System; |
判断两个数据表的内容是否相同
1 | public static bool EqualsByContent(this DataTable thisDataTable, DataTable otherDataTable) |
导出DataReader为CSV (List
1 | public static List<string> ToCSV(this IDataReader dataReader, bool includeHeaderAsFirstRow, string separator) |
C#扩展格式化方法
1 | /// <summary> |
C#扩展foreach,可以传入action
1 | public static IEnumerable<T> ForEach<T>(this IEnumerable<T> array, Action<T> act) |
Insert an item to a sorted List
1 | static class Extensions { |
Update your browser to view this website correctly. Update my browser now