C#
Lan_Ann
这个作者很懒,什么都没留下…
展开
-
C#DataTable转csv文件
private void dtToCSV(DataTable dt, string filepath) { if (dt == null) { return; } using (FileStream fsWrite = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write)) { ..原创 2021-04-21 16:25:19 · 292 阅读 · 0 评论 -
C#16进制转byte数组
public static byte[] ByteArrayToHexString(string hexString) { string h = hexString; hexString = hexString.Replace("0x",""); byte[] byteArray; if (hexString != "") { ...原创 2021-04-21 16:01:52 · 520 阅读 · 0 评论 -
winform实现CheckBox全选
winform实现CheckBox全选private void btnCheckAll_Click(object sender, EventArgs e) { foreach (Control con in groupBox1.Controls) { if (con is CheckBox) { CheckBox chk = con a原创 2021-04-21 14:13:24 · 639 阅读 · 0 评论 -
C#文字转语音
需要引用DotNetSpeech.dll/// <summary> /// MainWindow.xaml 的交互逻辑 /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private原创 2021-04-21 14:46:32 · 425 阅读 · 0 评论 -
C#使用SqlBuckCopy批量插入数据
当需要插入大量数据时,使用SqlBuckCopy效率较高,现将要插入的数据添加到DataTable中。如果新生成ID号,使用SqlBulkCopyOptions.UseInternalTransaction,保留原来的ID,用SqlBulkCopyOptions.KeepIdentity//sqlBulkCopy public static string BatchInsertBySqlBulkCopy(DataTable dt, string tableName) {原创 2021-04-21 15:22:23 · 334 阅读 · 0 评论