会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
starriver
博客园
首页
新随笔
联系
订阅
管理
2019年1月15日
实现点击任务栏图标显示或隐藏窗体
摘要: /// /// 实现点击任务栏图标显示或隐藏窗体 /// protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.Style = cp.Style | 0x20000;//允许最小化操作 return...
阅读全文
posted @ 2019-01-15 15:49 starriver
阅读(389)
评论(0)
推荐(0)
2018年7月25日
C#读写Excel
摘要: Dictionary dict = new Dictionary(); List list = new List(); object missing = Missing.Value; Application excel = new Application(); excel.Visible = false; excel.UserControl = true; Workbook book = ex...
阅读全文
posted @ 2018-07-25 13:37 starriver
阅读(592)
评论(0)
推荐(0)
数据库查询的table结果转成对应实体类
摘要: /// /// table转实体类 /// /// private static void Model(System.Data.DataTable table) { models = new List(); foreach (DataRow row in table.Rows) { T model = new T(); foreach...
阅读全文
posted @ 2018-07-25 11:50 starriver
阅读(735)
评论(0)
推荐(0)
连接oracle(不需要下载其他程序,只引用一个dll)
摘要: OracleConnection con = new OracleConnection(@"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XXX)));Persist Security Info=True;User ID=XXX;Pas...
阅读全文
posted @ 2018-07-25 11:49 starriver
阅读(403)
评论(0)
推荐(0)
2017年11月13日
死锁现象
摘要: 为了避免死锁,可以在应用程序的体系架构中一开始就设计好锁定顺序,也可以为锁定定义超时时间
阅读全文
posted @ 2017-11-13 17:21 starriver
阅读(131)
评论(0)
推荐(0)
2017年11月7日
阻止控件重绘
摘要: //控件重绘 [DllImport("USER32.DLL ", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool SendMessage( IntPtr hWnd, // 目标窗口句柄 int Msg, // 消息 bool wParam, // 第一个消息参数 fals...
阅读全文
posted @ 2017-11-07 10:42 starriver
阅读(231)
评论(0)
推荐(0)
winform中的panel滚动条
摘要: private void panel1_Paint(object sender, PaintEventArgs e) { Control _Control = (Control)sender; ShowScrollBar(_Control.Handle, 4, 0); } /// /// 禁用panel垂直或者水平滚动条 /// /// /// 0垂直滚动条,1水平滚动条,...
阅读全文
posted @ 2017-11-07 10:18 starriver
阅读(6549)
评论(0)
推荐(1)
实现通过鼠标的中间的滑轮控制滚动条
摘要: public Form1() { InitializeComponent(); this.MouseWheel += Form1_MouseWheel; } /// /// 滚动方法 /// /// /// void Form1_MouseWheel(object sender, MouseEventArgs e) { //获取光标位置 Point mou...
阅读全文
posted @ 2017-11-07 09:47 starriver
阅读(476)
评论(0)
推荐(0)
2017年11月2日
动态创建加载程序集
摘要: public class CodeProvider { //动态创建Driver类 private string strStart = "using System;" + "public static class Driver { public static void Main(){ "; private string strEnd = " } }"; /// ...
阅读全文
posted @ 2017-11-02 17:01 starriver
阅读(240)
评论(0)
推荐(0)
公告