随笔分类 -  c#

摘要:wpf需要在分屏上显示窗体代码: <Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.micros 阅读全文
posted @ 2023-01-10 13:56 fulllove 阅读(579) 评论(0) 推荐(1) 编辑
摘要:方法一:Get请求: /// <summary> /// httpRequest /// </summary> /// <param name="url">http接口路径</param> /// <returns>将http接口信息进行返回</returns> public string http 阅读全文
posted @ 2023-01-06 14:53 fulllove 阅读(65) 评论(0) 推荐(0) 编辑
摘要:一、方法方法一(winform实现): 安装VLC media player3.0,然后将安装的plugins文件复制到项目根目录, 1、新建一个类(VlcPlayerBase.cs): using System; using System.Runtime.InteropServices; usin 阅读全文
posted @ 2023-01-05 17:10 fulllove 阅读(506) 评论(0) 推荐(0) 编辑
摘要:pdf转byte[]再转pdf文件进行保存 /// <summary> /// pdf转byte[]再转pdf文件进行保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private vo 阅读全文
posted @ 2022-12-26 16:37 fulllove 阅读(3178) 评论(0) 推荐(0) 编辑
摘要:项目需求获取某路径下为1开头文件夹,并替换最新文件夹内容,话不多说,上代码 private void Form1_Load(object sender, EventArgs e) { try { string str1 = Properties.Settings.Default.path;//此路径 阅读全文
posted @ 2022-09-15 16:29 fulllove 阅读(322) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 拷贝文件到另两个文件夹下 /// </summary> /// <param name="sourceName">新文件路径</param> /// <param name="folderPath">需替换的文件夹路径1</param> ///<param nam 阅读全文
posted @ 2022-09-07 11:51 fulllove 阅读(777) 评论(0) 推荐(0) 编辑
摘要:#region 方法一 Point first = this.Location; for (int i = 0; i < 50; i++) { Application.DoEvents(); Random ran = new Random(); Point p = new Point(this.Lo 阅读全文
posted @ 2022-09-02 14:09 fulllove 阅读(51) 评论(0) 推荐(0) 编辑
摘要:方法一: 函数: // Find Window // 查找窗体 // @para1: 窗体的类名 例如对话框类是"#32770" // @para2: 窗体的标题 例如打开记事本 标题是"无标题 - 记事本" 注意 - 号两侧的空格 // return: 窗体的句柄 [DllImport("User 阅读全文
posted @ 2022-09-01 11:27 fulllove 阅读(6503) 评论(0) 推荐(0) 编辑
摘要:@echo off ::关闭/杀死进程 @taskkill /f /IM Hos.exe ::等待10秒 start /min /w mshta vbscript:setTimeout("window.close()",10000) ::启动程序 start Hos.exe exit 阅读全文
posted @ 2022-03-30 16:49 fulllove 阅读(932) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 导出excel文件 /// </summary> /// <param name="dt">Table表数据</param> /// <param name="path">存放路径 ( string path = System.Environment.Curren 阅读全文
posted @ 2021-11-18 14:12 fulllove 阅读(550) 评论(0) 推荐(0) 编辑
摘要:#region 监听url #region 监听url路径请求 static HttpListener httpobj; private void listeningUrl() { //提供一个简单的、可通过编程方式控制的 HTTP 协议侦听器。此类不能被继承。 httpobj = new Http 阅读全文
posted @ 2021-11-08 10:19 fulllove 阅读(596) 评论(0) 推荐(0) 编辑
摘要:#region Base64加密方法 /// <summary> /// Base64加密,采用utf8编码方式加密 /// </summary> /// <param name="source">待加密的明文</param> /// <returns>加密后的字符串</returns> publi 阅读全文
posted @ 2021-11-08 10:13 fulllove 阅读(957) 评论(0) 推荐(0) 编辑
摘要:1、单个字符分隔用split截取 string str = "GT123_1"; string[] strArray = str.Split('_'); //输出:sArray[0]="GT123" // sArray[1]="1" 2、利用多个字符来分隔字符串 string str = "GTAZ 阅读全文
posted @ 2021-10-18 15:07 fulllove 阅读(669) 评论(0) 推荐(0) 编辑
摘要:校验数字的表达式 //数字 Regex reg = new Regex(@"^[0-9]*$"); //n位的数字 Regex reg = new Regex(@"^\d{n}$"); //至少n位的数字 Regex reg = new Regex(@"^\d{n,}$"); //m-n位的数字 R 阅读全文
posted @ 2021-10-18 14:33 fulllove 阅读(59) 评论(0) 推荐(0) 编辑
摘要:public static string DataTable2Json(DataTable dt) { StringBuilder jsonBuilder = new StringBuilder(); jsonBuilder.Append("{\""); jsonBuilder.Append(dt. 阅读全文
posted @ 2021-10-15 14:53 fulllove 阅读(94) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示