随笔分类 -  c#

上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要:namespace ConsoleApplication1 { public class Program { private ITestA A; public Program(ITestA B) { A = B; } static void Main(string[] args) { //TestA 阅读全文
posted @ 2018-04-19 16:40 enych 阅读(1127) 评论(0) 推荐(1)
摘要:using Model; using System.Collections.Generic; using System.Text; public class Class1 { #region 生成Model类 public void testff() { #region 数据库ID所对应的类型值 Dictionary DicType ... 阅读全文
posted @ 2018-04-13 16:39 enych 阅读(4250) 评论(0) 推荐(0)
摘要:using System.Collections.Generic; using System.Text; public class Class1 { //传递 1.表名 2.列名 3.类型 public void GenerateModel(string TableName, string ColumnName, string TypeName)... 阅读全文
posted @ 2018-04-12 16:42 enych 阅读(1243) 评论(0) 推荐(0)
摘要:MessageBox.Show(true ? true ? "A" : "B" : "C"); MessageBox.Show(true ? "3" : "4"); 阅读全文
posted @ 2018-04-12 10:58 enych 阅读(2031) 评论(0) 推荐(0)
摘要:switch ("MySql") //选择语句 // case语句 成对 结束 执行到 第一个break { case "SqlServer2000": case "SqlServer2005": case "SqlServer2008": ... 阅读全文
posted @ 2018-04-11 17:25 enych 阅读(446) 评论(0) 推荐(0)
摘要:namespace test { using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; public class Form1 : Form // public partial class Form1 : Form ... 阅读全文
posted @ 2018-04-11 15:28 enych 阅读(1097) 评论(0) 推荐(0)
摘要:using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("test")] //程序集标题 [as... 阅读全文
posted @ 2018-04-11 15:10 enych 阅读(164) 评论(0) 推荐(0)
摘要:C#的split函数分割 var words = strs.Split((string[])strlist, StringSplitOptions.RemoveEmptyEntries); 阅读全文
posted @ 2018-03-11 12:01 enych 阅读(3663) 评论(0) 推荐(0)
摘要:#region 加载数据到DataGraidView private void button1_Click(object sender, EventArgs e) { string excelPath = textBox1.Text.Trim(); //string excelPath = "测试.xlsx"; /... 阅读全文
posted @ 2018-03-07 15:51 enych 阅读(876) 评论(0) 推荐(0)
摘要:dt = new DataTable(); dt.Columns.Add("a"); dt.Columns.Add("b"); dt.Rows.Add(1); object[] iis = new object[2]; iis[0] = 1; iis[1] = 2; dt.Rows.Add(iis) 阅读全文
posted @ 2018-03-07 15:11 enych 阅读(3734) 评论(0) 推荐(1)
摘要:var filename = ""; //去掉扩展名 if (file.FileName.LastIndexOf(".") != -1) { filename = file.FileName.Substring(0, file.FileName.LastIndexOf(".")); } else { 阅读全文
posted @ 2018-03-07 15:00 enych 阅读(3003) 评论(0) 推荐(0)
摘要:public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string str1,str 阅读全文
posted @ 2018-03-07 13:49 enych 阅读(798) 评论(0) 推荐(0)
摘要:// 阅读全文
posted @ 2018-02-27 16:32 enych 阅读(1542) 评论(0) 推荐(0)
摘要:public ActionResult Index() { #region 写入Cookies HttpCookie cookie = new HttpCookie("CookieName");//初使化并设置Cookie的名称 DateTime dt = DateTime.Now; //获取当前时间 ... 阅读全文
posted @ 2018-02-27 15:47 enych 阅读(8507) 评论(2) 推荐(0)
摘要:private void button1_Click(object sender, EventArgs e) { int a = 6; int b = 66; Fun(ref a,ref b); //把a的地址和b的地址 传递过去 MessageBox.Show(a.... 阅读全文
posted @ 2018-02-27 15:13 enych 阅读(165) 评论(0) 推荐(0)
摘要:// 分隔符号 // 功能 遍历html select 标签 中的键值对 加入到集合 //循环查找字符串并截取 阅读全文
posted @ 2018-02-07 11:08 enych 阅读(741) 评论(0) 推荐(0)
摘要:/// /// 增加一条数据 /// public int Add(string 表名,string 参数,string 参数值) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into ")... 阅读全文
posted @ 2018-01-24 14:12 enych 阅读(938) 评论(0) 推荐(0)
摘要:private string GetGeneralContent(string strUrl) { string strMsg = string.Empty; try { WebRequest request = WebRequest.Create(strUrl); ... 阅读全文
posted @ 2018-01-23 15:42 enych 阅读(210) 评论(0) 推荐(0)
摘要://.方法一:采用OleDB读取EXCEL文件: //打开excel 返回指定表中的所有数据 public DataSet ExcelToDS(string Path) { string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + P... 阅读全文
posted @ 2018-01-22 20:20 enych 阅读(333) 评论(0) 推荐(0)
摘要://读取EXCEL public static DataSet LoadDataFromExcel(string filePath) //加载excel 返回DataSet内存数据库 { try { string strConn; strConn = "... 阅读全文
posted @ 2018-01-22 17:25 enych 阅读(243) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 下一页