随笔分类 - .net
摘要:private string GetMD5Hash(string str) { string md5Str = ""; byte[] buffer = Encoding.UTF8.GetBytes(str); MD5CryptoServiceProvider md5 = new MD5Crypt...
阅读全文
posted @ 2017-03-22 17:01
lishidefengchen
摘要:<input type="button" id="btnCancel" value="取消" onclick="cancel()" /> //取消function cancel() { window.frameElement.cancelPopUp();}
阅读全文
posted @ 2016-11-28 14:17
lishidefengchen
摘要://result 是一个待去重的数据源 DataView dv = new DataView(result); DataTable dt2 = dv.ToTable(true, "DEP_NAME", "Code");
阅读全文
posted @ 2016-10-12 14:24
lishidefengchen
摘要:using System.DirectoryServices; using System.DirectoryServices.AccountManagement; using (DirectoryEntry adsEntry = new DirectoryEntry("LDAP://test.com", userName, password, AuthenticationTypes.Sec...
阅读全文
posted @ 2016-08-05 14:24
lishidefengchen
摘要:List bdList = allAsset.Where(m => m.Owner.Depts == view.DeptName).ToList(); var query = from item in bdList group item by new ...
阅读全文
posted @ 2016-07-18 17:03
lishidefengchen
摘要:public partial class _222 : DbMigration { public override void Up() { //DropForeignKey("dbo.Assets", "AssetBorrow_Id", "dbo.AssetBorrows"); //DropIndex("d...
阅读全文
posted @ 2016-06-01 13:51
lishidefengchen
摘要:public partial class _111111 : DbMigration { public override void Up() { CreateTable( "dbo.AssetBorrows", c => new ...
阅读全文
posted @ 2016-06-01 13:50
lishidefengchen
摘要:更新程序后,如果还是报错,就把数据库中_MigrationsHistory这个表删除了,再试一下,应该就会好了。而_MigrationsHistory这个表会在下次执行Migrations命令的时候自动创建,所以不必担心删除了,后续无法运行Migrations命令。
阅读全文
posted @ 2016-05-25 19:54
lishidefengchen
摘要:情景:SharePoint项目(其他类型的项目道理也一样),数据库是用EF(版本:6.0.0.0)创建的,生产环境已经使用,所以后续修改数据库,只能通过更新来实现。 下面是具体的操作方式: 1、visual studio 打开项目,打开“程序包管理控制台”。 操作方式:视图--其他窗口--程序包管理
阅读全文
posted @ 2016-04-26 17:28
lishidefengchen
摘要:test.dll20161111和test.dll同目录的时候,会报错!因为这样跟test1.dll(只是重名民)的效果是一样的,都会报错的。 同目录的情况下,应该改成test.dll.ddd。 为了避免这种错误,最好备份应该是拷贝到其他目录下面。
阅读全文
posted @ 2016-04-14 18:21
lishidefengchen
摘要:slice<摘抄自http://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000/00143449921138898cdeb7fc2214dc08c6c67827758cd2f000>slice()
阅读全文
posted @ 2016-04-05 18:17
lishidefengchen
摘要:说明: strFilePath是文件全路径; 使用的 NPOI 版本是 2.1.3.1
阅读全文
posted @ 2016-04-05 10:57
lishidefengchen
摘要:/// /// 获取单元格的值 /// /// /// public static object GetCellValue(ICell item) { if (item == null) { return stri...
阅读全文
posted @ 2016-04-05 10:48
lishidefengchen
摘要:using (var ctx = new PortalContext()){ var city = ctx.Cities.Find(42); ctx.Entry(city) .Reference(c => c.Province) .Load(); city.Province = null; ctx.
阅读全文
posted @ 2016-03-30 17:44
lishidefengchen
摘要:https://www.guidgenerator.com/online-guid-generator.aspx
阅读全文
posted @ 2016-03-30 10:10
lishidefengchen
摘要:C#后台获取客户端浏览器的类型: Request.Browser.Type; ("Firefox44"、 "IE7"、 "Chrome49"等,忽略版本问题)
阅读全文
posted @ 2016-03-18 17:37
lishidefengchen
摘要:linq的条件语句尽量不要出现计算的式子,要不然很可能,程序不能正确的将这些复杂的式子编译成表达式!! 例如: dataContext.Assets.Count(s => s.SubCategory.Id == ‘这里最好是一个变量,不要出现表达式’)
阅读全文
posted @ 2016-03-16 17:13
lishidefengchen

浙公网安备 33010602011771号