C#
weixin_44345664
这个作者很懒,什么都没留下…
展开
-
获取视频第一帧
C#原创 2023-01-13 14:28:25 · 545 阅读 · 1 评论 -
c#JSON转换
json转换原创 2022-06-17 17:27:50 · 167 阅读 · 0 评论 -
wpf 的itemsource绑定更新问题
我定义个 List<Student> stuList = new List<Student>();然后绑定 this.combobox1.ItemsSource =stuList;我更新了一下stuList,然后再次绑定,这里就有异常了。我想第二次更新了stuList后,让Combobox也更新。有两种方法:一种是将student类继承notifychanged接口,然后把stuList的类型从list改ObservableCollection。这样数据源更新了,C转载 2022-05-09 15:03:27 · 918 阅读 · 0 评论 -
extern外部方法使用C#简单例子
外部方法使用C#简单例子1、增加引用using System.Runtime.InteropServices;2、声明和实现的连接[DllImport(“kernel32”, SetLastError = true)]3、声明外部方法public static extern int GetCurrentDirectory(int a, StringBuilder b);4、对外部方法操作 GetCurrentDirectory(300, pathstring);using System;usin转载 2021-05-23 10:57:06 · 154 阅读 · 0 评论 -
C# Activator和new的区别
1、你需要动态的创建一个实例模型的时候,就用Activator.CreateInstance(Type type);如果是明确的知道要创建哪个实例的模型,就可以用 new Class1()了。T tInstance= (T)Activator.CreateInstance(typeof(T), new object[] { message });12、基于接口的Remoting对象是不能用new来创建的,可以直接使用Activator来创建3、C#中Activator.CreateInstance(转载 2021-05-14 15:45:39 · 233 阅读 · 0 评论 -
C#委托
c# 委托 delegate委托是一种存储函数引用的类型,在事件和事件的处理时有重要的用途通俗的说,委托是一个可以引用方法的类型,当创建一个委托,也就创建一个引用方法的变量,进而就可以调用那个方法,即委托可以调用它所指的方法。使用委托委托的使用需要以下步骤:定义委托delegate double ParocessDelegate(double param1,double param2);委托的定义非常类似于函数,但不带函数体,且要使用delegate关键字。委托定义需要指明委托名称以及一个返回转载 2021-05-10 16:58:41 · 48 阅读 · 0 评论 -
C# 连接WebService方法
1.采用添加服务引用的方式调用WebService调用代码/// /// 实例化连接/// WebReference.WebService1 service1 = new WebReference.WebService1();private void button1_Click(object sender, EventArgs e){//调用无参方法var result = service1.HelloWorld();//调用有参方法var result1 = service1.Syn转载 2021-05-05 13:46:42 · 333 阅读 · 0 评论 -
C# SQLite 数据库操作
https://www.cnblogs.com/leemano/p/6578050.html转载 2021-04-14 08:30:25 · 34 阅读 · 0 评论 -
操作 Windows 窗体 DataGridView 控件中的列
using System.Windows.Forms;using System;using System.Drawing;public class DataGridViewColumnDemo : Form{ #region "set up form" public DataGridViewColumnDemo() { InitializeComponent(); AddButton(Button1, "Reset",转载 2021-04-14 08:28:44 · 160 阅读 · 0 评论 -
如何在VS中添加SQLite的引用
在VS中想用C# 操作 SQLite首先第一步都要添加SQLite引用,要添加SQLite引用首先要按照对应的SQLite包。网上提供了很多SQLite包,到底该安装哪个呢?曾经我也走了不少弯路,后来发现,最简单的做法是在VS中选择【工具】→【 Nuget包管理器】→【程序包管理器控制台】打开【程序包管理器控制台】。然后输入Install-Package System.Data.SQLite按下回车,即可快速地安装所有的SQLite相关的包,并且在当前的项目中添加相关的引用。...转载 2021-04-13 18:54:31 · 689 阅读 · 0 评论 -
C# DataGridView动态添加新行的2个方法
方法一:int index=this.dataGridView1.Rows.Add();this.dataGridView1.Rows[index].Cells[0].Value = “1”;this.dataGridView1.Rows[index].Cells[1].Value = “2”;this.dataGridView1.Rows[index].Cells[2].Value = “监听”;利用dataGridView1.Rows.Add()事件为DataGridView控件增加新的行,该转载 2021-04-13 18:49:44 · 2448 阅读 · 0 评论 -
C# 控件随窗体自动变化
#region 控件随窗体自动变化 /// <summary> /// 自动调整空间大小; /// </summary> private Size m_szInit;//初始窗体大小; private Dictionary<Control, System.Drawing.Rectangle> m_dicSize = new Dictionary<Control, System.Drawing.Rectangle>...原创 2021-04-06 14:36:33 · 391 阅读 · 0 评论