随笔分类 -  C#

C#
摘要:项目中用的4.0,本机没问题,服务器上出现问题,查了一下发现 autofac 里面用的这个版本 解决:下载安装这个4.0的补丁 http://support.microsoft.com/kb/2468871 或者 安装更高的版本如 4.5 https://www.microsoft.com/zh-c 阅读全文
posted @ 2018-07-04 17:53 VipSoft 阅读(489) 评论(0) 推荐(0) 编辑
摘要:C# 阅读全文
posted @ 2017-09-08 16:57 VipSoft 阅读(268) 评论(0) 推荐(0) 编辑
摘要:C# 通过Attitude特性来实现,相对方便些 namespace Extensions { /// <summary> /// 定义枚举扩展类 /// </summary> public static class EnumExtensions { /// <summary> /// 获取枚举变量 阅读全文
posted @ 2017-09-05 10:44 VipSoft 阅读(831) 评论(0) 推荐(0) 编辑
摘要:现在已经用 NLog .Net Core NLog 配置 记录日志了 工具没有好坏,只有适不适用。由于项目中用 Log4Net 过重,所以使用 Trace 代替了 Log4Net 输入一些简单的日志信息; 自定义监听文件 using System; using System.Configuratio 阅读全文
posted @ 2017-08-24 00:47 VipSoft 阅读(630) 评论(0) 推荐(0) 编辑
摘要:1.可传参数 namespace DrugInfo { public class ChooseDrugRoutedEventArgs : RoutedEventArgs { public ChooseDrugRoutedEventArgs(RoutedEvent routedEvent, objec 阅读全文
posted @ 2017-06-15 23:36 VipSoft 阅读(1089) 评论(0) 推荐(0) 编辑
摘要:C盘空间老是不够用。清除Font Cache 1.在 C:\Users\Jimmy\AppData\Local\Microsoft\Visual Studio 下的 Font Cache 目录可以干掉。 阅读全文
posted @ 2017-03-22 12:37 VipSoft 阅读(1200) 评论(1) 推荐(0) 编辑
摘要:突然有一天,代码文件夹上的版本控制图标不见了。 注册表中,将文件夹名重命名,让版本控制的靠前,Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \ ShellIconO 阅读全文
posted @ 2016-08-19 11:11 VipSoft 阅读(1833) 评论(0) 推荐(0) 编辑
摘要:C# async await 异步执行方法 private void Operate_OnClick(object sender, RoutedEventArgs e) { AsyncFindBox(); RadWindow.Alert("测试测试!"); } private void AsyncF 阅读全文
posted @ 2015-05-28 09:13 VipSoft 阅读(7070) 评论(0) 推荐(0) 编辑
摘要:用递归实现无限级菜单,产品分类,盖楼式评论、留言等功能。 下列代码不能直接使用 阅读全文
posted @ 2015-03-17 08:43 VipSoft 阅读(20430) 评论(3) 推荐(0) 编辑
摘要:将目录下面所有的 .cs 文件合并到一个 code.cs 文件中,写著作权复制代码时的必备良药 @echo off echo 将该目录下所有.cs文件的内容合并到一个 code.cs 文件中! pause dir /ad/s/b > folderPath.txt md codeTemp for /f 阅读全文
posted @ 2014-12-28 15:05 VipSoft 阅读(656) 评论(3) 推荐(3) 编辑
摘要:一个字段控制多个状态选项private void GenerateAdvice_OnClick(object sender, RoutedEventArgs e){ TestStatus c1 = TestStatus.A | TestStatus.C | TestStatus.E; v... 阅读全文
posted @ 2014-12-17 17:10 VipSoft 阅读(393) 评论(0) 推荐(2) 编辑
摘要:public static bool ProcessIdCard(this string idCard, out DateTime birthday, out string genderName) { bool result; birthda... 阅读全文
posted @ 2014-12-04 15:17 VipSoft 阅读(326) 评论(0) 推荐(0) 编辑
摘要:一般来说一个 HTML 文档有很多标签,比如“<html>”、“<body>”、“<table>”等,想把文档中的 img 标签提取出来并不是一件容易的事。由于 img 标签样式变化多端,使提取的时候用程序寻找并不容易。于是想要寻找它们就必须写一个非常健全的正则表达式,不然有可能会找得不全,或者找出 阅读全文
posted @ 2014-11-20 11:52 VipSoft 阅读(9027) 评论(2) 推荐(7) 编辑
摘要:1:最直白的循环遍历方法,可以分为遍历key--value键值对以及所有的key两种表现形式2:用Linq的方式去查询(当然了这里要添加对应的命名空间 using System.Linq)如下为一个十分简单的代码示例:private void GetDicKeyByValue(){ Dicti... 阅读全文
posted @ 2014-09-28 12:28 VipSoft 阅读(3829) 评论(0) 推荐(0) 编辑
摘要:C# 跳转新页面判断URL文件是不是在于在。C# 指定物理目录下载文件,Response.End导致“正在中止线程”异常的问题public class FileHandler { public static bool DownLoadFile(string path, string fileName) { bool result = false; if (!string.IsNullOrEmpty(path)) { if (path.StartsWith("http... 阅读全文
posted @ 2014-03-27 10:35 VipSoft 阅读(1692) 评论(0) 推荐(0) 编辑
摘要:判断URL文件是不是在于在。private static bool UrlIsExist(string url){ System.Uri u = null; try { u = new Uri(url); } catch { return false; } bool isExist = false; System.Net.HttpWebRequest r = System.Net.HttpWebRequest.Create(u) as System.Net.HttpWebRequest; r.Method = "HEAD"; ... 阅读全文
posted @ 2014-03-27 10:31 VipSoft 阅读(359) 评论(0) 推荐(0) 编辑
摘要:C# 跳转新页面string url = "http://www.vipsoft.com.cn";ResponseRedirect.Redirect(Response, url, "_blank", "'toolbar=0,scrollbars=1,status=0,menubar=0,resizable=1,top=0,left=0,height=800,width=1000");}调用下面代码public class ResponseRedirect { public static void Redirect(HttpRe 阅读全文
posted @ 2014-03-27 10:25 VipSoft 阅读(8166) 评论(0) 推荐(0) 编辑
摘要:System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. at System.Data.DataTable.EnableConstraints() at System.Data.DataTable.set_EnforceConstraints(Boolean value) at System.Data.DataTable.EndLoadDat... 阅读全文
posted @ 2014-02-28 16:22 VipSoft 阅读(2933) 评论(0) 推荐(0) 编辑
摘要:FileHandlerhttp://www.cnblogs.com/vipsoft/p/3627709.htmlUpdatePanel无法导出下载文件:http://www.cnblogs.com/vipsoft/p/3298299.html//相对路径下载。path: ~/DownLoad///public static bool DownLoadFile(string path, string fileName){ bool result = false; try { string filePath = HttpContext.Current.Server... 阅读全文
posted @ 2014-01-16 09:35 VipSoft 阅读(4397) 评论(0) 推荐(0) 编辑
摘要:protected void Page_Load(object sender, EventArgs e){ ScriptManager sm = Page.Master.FindControl("ScriptManager1") as ScriptManager; if (sm != null) { foreach (GridViewRow item in gvInvoiceHistory.Rows) { LinkButton lbtnTemp = item.FindControl("btnInvoiceNumber") a... 阅读全文
posted @ 2013-09-03 11:04 VipSoft 阅读(1995) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示