随笔分类 -  C#

摘要:一、TransactionScope 环境事务 二、嵌套事务 事务完成代码 你可能不知道这一点,在 .NET Framework 4.5.0 版本中包含有一个关于 System.Transactions.TransactionScope 在与 async/await 一起工作时会产生的一个严重的 b 阅读全文
posted @ 2016-11-28 14:58 指间的徘徊 阅读(5510) 评论(0) 推荐(1)
摘要:class 1 //student 2 [Serializable] 3 public class Student 4 { 5 public string FirstName { get; set; } 6 public string LastName { get; set; } 7 public 阅读全文
posted @ 2016-11-28 11:23 指间的徘徊 阅读(3380) 评论(0) 推荐(0)
摘要:读取文件 File.ReadAllText(textBox1.Text,Encoding.ASCII); Form 1 namespace ReadWriteText 2 { 3 public partial class Form1 : Form 4 { 5 private readonly Ope 阅读全文
posted @ 2016-11-24 17:11 指间的徘徊 阅读(643) 评论(0) 推荐(0)
摘要:Form 1 namespace FileProperties 2 { 3 public partial class Form1 : Form 4 { 5 private string currentFolderPath; 6 7 public Form1() 8 { 9 InitializeCom 阅读全文
posted @ 2016-11-24 15:25 指间的徘徊 阅读(191) 评论(0) 推荐(0)
摘要:一、标识和Principal 1 static void Main(string[] args) 2 { 3 AppDomain.CurrentDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPri 阅读全文
posted @ 2016-11-23 10:48 指间的徘徊 阅读(907) 评论(0) 推荐(0)
摘要:1、数据流使用 TPL Data Flow 类库 阅读全文
posted @ 2016-11-22 16:00 指间的徘徊 阅读(248) 评论(0) 推荐(0)
摘要:Timer 类使用 阅读全文
posted @ 2016-11-22 14:14 指间的徘徊 阅读(164) 评论(0) 推荐(0)
摘要:1、得到本周的第一天和最后一天 阅读全文
posted @ 2016-11-22 14:04 指间的徘徊 阅读(5958) 评论(0) 推荐(0)
摘要:DataTable dt = new DataTable(); dt.Columns.Add("Name"); dt.Columns.Add("Age"); DataRow dr1 = dt.NewRow(); dr1["Name"] = "a"; d... 阅读全文
posted @ 2016-11-22 13:59 指间的徘徊 阅读(3736) 评论(0) 推荐(0)
摘要:线程池使用, 线程池中线程均为后台线程 Thread类使用 阅读全文
posted @ 2016-11-21 16:04 指间的徘徊 阅读(184) 评论(0) 推荐(0)
摘要:ftp://用户名:密码@IP/路径 FTP的一种登陆方式 如ftp://sing:song@192.168.1.133/upload/pic/236.jpg 阅读全文
posted @ 2016-11-11 10:19 指间的徘徊 阅读(3370) 评论(0) 推荐(1)
摘要:测试连接 http://api.map.baidu.com/geocoder/v2/ak=ZndyfXErtTiZQwfgNgQ7yqb7ALKdk4DA&location=39.963175,116.400244&output=json 接口详细说明地址:http://lbsyun.baidu.c 阅读全文
posted @ 2016-11-09 20:48 指间的徘徊 阅读(1513) 评论(0) 推荐(0)
摘要:取消架构 1、Parallel.For()方法的取消 2、任务的取消 阅读全文
posted @ 2016-11-04 17:03 指间的徘徊 阅读(233) 评论(0) 推荐(0)
摘要:1、线程池中的任务 2、同步任务 3、使用单独线程的任务 4、Future 任务结果 5、连续任务 6、任务层次结构 阅读全文
posted @ 2016-11-04 14:27 指间的徘徊 阅读(314) 评论(0) 推荐(0)
摘要:async 、 await 使用 条件退出 For<T> 使用 ForEach<T> 使用 Invoke 方法组调用 阅读全文
posted @ 2016-11-04 14:13 指间的徘徊 阅读(2253) 评论(0) 推荐(0)
摘要:命名空间 : using System.Diagnostics.Contracts; 属性标记 : [ContractOption(category: "runtime", setting: "checking", enabled: true)] 事件订阅 : Contract.ContractFa 阅读全文
posted @ 2016-11-03 15:56 指间的徘徊 阅读(1313) 评论(0) 推荐(0)
摘要:定义动态程序集 1 namespace DynamicAssembly 2 { 3 4 public class CodeDriver : MarshalByRefObject 5 { 6 private string prefix = 7 "using System;" + 8 "public s 阅读全文
posted @ 2016-10-28 14:05 指间的徘徊 阅读(338) 评论(0) 推荐(0)
摘要:详解 (1) public bool Start () System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = "iexplore.exe"; //IE浏览 阅读全文
posted @ 2016-10-27 14:55 指间的徘徊 阅读(9161) 评论(0) 推荐(0)
摘要:首先编写ClickOnce更新事件, 配置项目发布 浏览发布地址进行安装 http://192.168.31.180:79/publish.htm 进行安装 点击update 更新,如果服务器上有版本更新, 就可下载文件覆盖 阅读全文
posted @ 2016-10-26 17:12 指间的徘徊 阅读(1563) 评论(0) 推荐(0)
摘要:1 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] 2 public class LastModifiedAttribute : Attribute 3 { 4 private reado... 阅读全文
posted @ 2016-10-21 13:52 指间的徘徊 阅读(631) 评论(0) 推荐(0)