上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 19 下一页
摘要: /// /// 随机返回一条数据 /// /// /// protected string GetRandomData(List list) { return list.OrderBy(_ => Guid.NewGuid()).First(); } 阅读全文
posted @ 2017-05-02 17:49 会弹猫的吉他 阅读(321) 评论(0) 推荐(0) 编辑
摘要: if (!System.IO.File.Exists(@"E:\\111.txt")) { Console.Write("没有找到文件!"); } System.IO.StreamReader sr = new System.IO.StreamReader(@"E:\\111.txt"); OutUrl = sr.ReadToEnd(); sr.Close(); 阅读全文
posted @ 2017-04-18 15:41 会弹猫的吉他 阅读(281) 评论(0) 推荐(0) 编辑
摘要: DllImport是System.Runtime.InteropServices命名空间下的一个属性类,其功能是提供从非托管DLL导出的函数的必要调用信息。 DllImport属性应用于方法,要求最少要提供包含入口点的dll的名称。 DllImport的定义如下: [AttributeUsage(AttributeTargets.Method)] pu... 阅读全文
posted @ 2017-04-11 13:37 会弹猫的吉他 阅读(4830) 评论(0) 推荐(0) 编辑
摘要: Int-->Enum (1)可以强制转换将整型转换成枚举类型。 例如:Colors color = (Colors)2 ,那么color即为Colors.Blue (2)利用Enum的静态方法ToObject。 public static Object ToObject(Type enumType,int value) 例如:Colors color = (Colors)Enum.To... 阅读全文
posted @ 2017-03-30 14:12 会弹猫的吉他 阅读(1560) 评论(0) 推荐(0) 编辑
摘要: 1.从string[]转List string[] str={“1”,”2”}; List list=new List(str); 2.从List转string[] List listS=new List(); listS.Add("str"); listS.Add("hello"); System.String[] str=listS.ToArray(); ... 阅读全文
posted @ 2017-03-02 09:17 会弹猫的吉他 阅读(159) 评论(0) 推荐(0) 编辑
摘要: List ltProduct = new List(Product.Split('|')); 阅读全文
posted @ 2017-02-28 13:23 会弹猫的吉他 阅读(297) 评论(0) 推荐(0) 编辑
摘要: public class CloseForm { [DllImport("user32", EntryPoint = "FindWindow")] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("us... 阅读全文
posted @ 2017-02-27 11:47 会弹猫的吉他 阅读(4306) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.Serialization.Formatters.Binary; using System.Text; using System.Web; using System.Xml.Seriali... 阅读全文
posted @ 2017-02-20 14:28 会弹猫的吉他 阅读(199) 评论(0) 推荐(0) 编辑
摘要: #region DataTable转Json /// /// DataTable转Json /// /// /// public static string DataTableToJson(DataTable dt) { StringBu... 阅读全文
posted @ 2017-02-20 14:14 会弹猫的吉他 阅读(146) 评论(0) 推荐(0) 编辑
摘要: MailSend("公司", "发送邮箱", "发送密码", "姓名", "接收邮箱", "说明", "详细内容").ToString(); public bool MailSend(string txtName, string txtEmail, string txtEmailPwd, string txtFormName, string txtFormEmail, string txtTit... 阅读全文
posted @ 2017-02-14 11:17 会弹猫的吉他 阅读(232) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 19 下一页