随笔分类 - C#
摘要:在用C#窗口应用程序写动态壁纸软件的时候,最核心的问题在于如何让一个窗口成为桌面,以及在置为桌面的时候全屏化,下面给出实现过程 原理:windows 最底层的窗体 Program Manage (如图所示),想要你的窗体出现在桌面icon后面,只需要把自己的窗体作为 Program Manage 的
阅读全文
摘要:在项目中常常常使用到DataTable,假设DataTable使用得当,不仅能使程序简洁有用,并且可以提高性能,达到事半功倍的效果,现对DataTable的使用技巧进行一下总结。 1、添加引用 using System.Data; 2、创建表 //创建一个空表 DataTable dt = new
阅读全文
摘要:连接数据库、操作数据库,本质是利用数据库提供的动态链接库MySql.Data.dll进行操作。MySql.Data.dll提供以下8个类: MySqlConnection: 连接MySQL服务器数据库。MySqlCommand:执行一条sql语句。MySqlDataReader: 包含sql语句执行
阅读全文
摘要://获取当前进程的完整路径,包含文件名(进程名)。 string str1 = this.GetType().Assembly.Location; //result: X:\xxx\xxx\xxx.exe(.exe文件所在的目录 +.exe文件名) //获取新的 Process 组件并将其与当前活动
阅读全文
摘要:1.创建数据库 use master go if exists(select * from sysdatabases where name='Test') begin select '该数据库已存在' drop database Test --如果该数据库已经存在,那么就删除它 end else b
阅读全文
摘要:C#连接SQL Server数据库,并解决 “已有打开的与此 Command 相关联的 DataReader,必须首先将它关闭” using System; using System.Collections.Generic; using System.Linq; using System.Text;
阅读全文
摘要:c#堆栈的使用 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace Test191112 { class P
阅读全文
摘要:C#的foreach循环替换for循环 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace Test1111
阅读全文
摘要:C#实现Hashtable中 根据键值对的值,然后进行删除这一个键值对 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; na
阅读全文