摘要:
字符串转rtf值 //字符串转rtf public string str2Rtf(string s) { string rtfFormattedString = ""; RichTextBox richTextBox = new RichTextBox(); richTextBox.Text = s 阅读全文
摘要:
打开文件 ```C# private void selectFile() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Files|*.png;*.jpg"; // 设定打开的文件类 阅读全文
摘要:
public static bool DownLoadFiles(string uri, string filefullpath, int size = 1024) { try { if (File.Exists(filefullpath)) { try { File.Delete(filefull 阅读全文
摘要:
等比例压缩 /// <summary> /// 压缩图片 /// </summary> /// <param name="filePath">文件路径</param> /// <param name="height">图像高度</param> /// <returns></returns> publ 阅读全文
摘要:
/// <summary> /// 写文件导到磁盘(异步) /// </summary> /// <param name="stream">数据流</param> /// <param name="path">文件路径</param> /// <returns></returns> public s 阅读全文
摘要:
AES加密与解密 /// <summary> /// AES 加密 /// </summary> /// <param name="str">明文</param> /// <param name="aesKey">密钥</param> /// <returns></returns> public 阅读全文
摘要:
/// <summary> /// 随机数 /// </summary> /// <param name="Length">长度</param> /// <returns></returns> public static string GenerateRandomNumber(int Length) 阅读全文
摘要:
播放Mp3音频 /// <summary> /// 播放音频, /// 1.添加新引用 COM组件的Microsoft Shell Controls And Automation /// 2.添加成功,引用中显示的为Shell32.dll,、 /// 3.设置Shell32.dll的属性为嵌入互操作 阅读全文
摘要:
计算音频的时长 /// <summary> /// 获取mp3文件的歌曲时间长度 /// </summary> /// <param name="songPath"></param> /// <returns></returns> private string GetMp3Times(string 阅读全文
摘要:
获取本机IP /// <summary> /// 获取本机IP地址 /// </summary> /// <returns></returns> private string GetHostAddressIP() { IPHostEntry ipHostEntry = Dns.GetHostEntr 阅读全文
摘要:
删除时间范围外文件 private static void DeleteOldLogs() { try { // string s =Directory.GetCurrentDirectory(); var path = Application.StartupPath + "\\ErrLog"; i 阅读全文
摘要:
根据进程名称关闭 public static void KillProcess(string Pname) { foreach (var v in Process.GetProcessesByName(Pname) { v.Kill(); } } 阅读全文
摘要:
窗体关闭事件 private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { try { if (e.CloseReason == CloseReason.UserClosing) { if (MessageBox. 阅读全文