- 博客(24)
- 收藏
- 关注
转载 触发DataGridView的CellClick事件
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;...
2018-06-16 08:13:00
1577
转载 c# WinForm Menu自动生成
1.将采用递归的方式生成窗体菜单,并且添加其事件响应 Type t = typeof(frmMain); private void GenerateMenu(ToolStripItemCollection parentItem, List<SpinSystem.Domain.Main.Menu> menus,string paentId...
2018-05-18 10:49:00
260
转载 策略模式
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace WindowsFormsApplication3{ abstract class CashSuper { public abstract d...
2018-05-08 16:54:00
127
转载 c#report基本操作赋值
//第一步:清除之前的数据 this.rptView.LocalReport.DataSources.Clear(); //第二步:指定报表路径 this.rptView.LocalReport.ReportPath = "Report2.rdlc"; //第三步:构造新的DataTable DataTable dt = new DataTable("...
2018-05-05 11:33:00
537
转载 判断线程30分钟后没有执行完就kill掉
using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;using System.Data;using System.IO;using System.Collections;using System.Threading;usin...
2018-05-03 11:18:00
228
转载 Dtagridview 光标定位最后行的方法 - 转自:jin_yao_chi的博客
定位行:1.BindingSource.MoveLast();2.dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows. Count-1;定位单元格:1.dataGridView1.FirstDisplayedCell = dataGridView1.Rows[xxx].Cells[0]; 2...
2018-04-30 10:47:00
261
转载 C#对XML文件的操作
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.OleDb;using Microsoft.Office.Interop.Excel;using System.Xml;...
2018-04-28 16:03:00
104
转载 C#执行CMD命令
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.OleDb;using Microsoft.Office.Interop.Excel;namespace Consol...
2018-04-28 15:52:00
81
转载 判断采用哪种浏览器
<scriptlanguage="JavaScript"><!--functiongetOs(){varOsObject="";if(navigator.userAgent.indexOf("MSIE")>0){return"MSIE";}...
2018-04-28 15:51:00
98
转载 C#排序功能-顺便求最大值
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.OleDb;using Microsoft.Office.Interop.Excel;namespace Consol...
2018-04-28 15:31:00
256
转载 C# 简单序列化与反序列化
//序列化 public void Serialize(Book book) { using (FileStream fs = new FileStream(strFile, FileMode.Create)...
2018-04-28 15:29:00
103
转载 使用Microsoft.Office.Interop.Excel提取Excel文件数据
将Excel数据提取出来放到二维数组中:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.OleDb;using Microsoft.Office.Interop.Exce...
2018-04-28 15:21:00
675
转载 VS2010快捷键-转别人的
Ctrl+E,D ----格式化全部代码Ctrl+E,F ----格式化选中的代码CTRL + SHIFT + B生成解决方案CTRL + F7 生成编译CTRL + O 打开文件CTRL + SHIFT + O打开项目CTRL + SHIFT + C显示类视图窗口F4 显示属性窗口...
2018-04-28 15:12:00
90
转载 过滤DataSet/DataTable的数据
过滤DataSet/DataTable的数据方法一:ds.Tables[0].DefaultView.RowFilter="name='"+textBox1.Text+"'";DataTabledt=ds.Tables[0].DefaultView.ToTable();dataGridView1.DataSource=dt;方法二:Select(...
2018-04-28 15:10:00
215
转载 动软代码生成器-生成模型填充代码
让开发者方便地生成数据层填充代码<#@ template language="c#" HostSpecific="True" #><#@ output extension= ".cs" #><# TableHost host = (TableHost)(Host); host.NameSpace = "SPC";...
2018-04-28 15:07:00
120
转载 Dictionary 类提取键与值
private void button1_Click(object sender, EventArgs e) { Dictionary<string, string> List = new Dictionary<string, string>(); List.Add("1", "A"); ...
2018-04-28 15:04:00
304
转载 MS Chart 折线图点击数据点时显示其值
对于MS Chart当鼠标移动到数据点时或鼠标点击数据点时显示其点的值(X,Y)值 public partial class Form1 : Form { System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs toolTipEventArgs; pub...
2018-04-28 14:56:00
1088
转载 C# IO 文件读写操作
StreamReader sr = new StreamReader(Directory.GetCurrentDirectory() + "\\test.txt")string line;while ((line = sr.ReadLine()) != null){ Console.WriteLine(line);}写操作...
2018-04-26 14:57:00
279
转载 C#常用字符串截取
1 取字符串的前i个字符 str=str.Substring(0,i); // or str=str.Remove(i,str.Length-i); 2 去掉字符串的前i个字符: str=str.Remove(0,i); // or str=str.Substring(i); 3 从右边开始取i个字符: str=str.Substring(str.L...
2018-04-26 14:53:00
97
转载 c# 小票打印功能
using System;using System.Collections.Generic;using System.Linq;using System.Printing;using System.Text;using System.Threading.Tasks;namespace PrintCore{ public static clas...
2018-04-26 14:49:00
569
转载 Observer(观察者模式)
Observer 定义一个一对多的依赖关系,让多个观察者对象同时监听某一个主题,这个主意对象在状态发生变化时会通知所有观察者对象,使它们能够自动更新自己.抽象主题(Subject) : 对观察者对象的引用保存在一个聚集里,提供一个接口,可增加和删除观察者对象.具体主题(ConcreteSubject) : 其内部状态改变时,给所有登记过的观察者发出通知.抽象观察者(Ob...
2017-08-24 11:31:00
104
转载 C#简单加密类
using System;using System.Collections.Generic;using System.Text;using System.Runtime.Serialization.Formatters.Binary;using System.IO;using System.Security.Cryptography;namespace E...
2017-05-03 15:01:00
144
转载 求两个数的奇数范围的和
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ class Program { ...
2014-01-26 12:15:00
215
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人