
asp.net(C#)
ice_baili
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Visual Studio 2015预览版系统需求
visual studio 2015预览版的系统需求跟visual studio 2013的一样。支持visual studio 2015 preview的操作系统:Windows 8.1(x86 和 x64)Windows 8(x86 和 x64)Windows 7 SP1(x86 和 x64)Windows Server 2012 R2 (x64)Windows S原创 2015-07-20 11:01:34 · 1156 阅读 · 0 评论 -
HTTP 错误 404.17 - Not Found
如果在ISAPI下关于Asp.net4.0部分 需要运行cmd,输入:C:\Windows\Microsoft.NET\Framework\V4.0.30319\aspnet_regiis -i原创 2015-08-19 13:15:13 · 541 阅读 · 0 评论 -
c# yield
yield关键字会告诉编译器当前的函数是在一个循环内部,编译器会相应生成一个执行它在循环体内部所表示行为的类,yield和return关键字一起用于为枚举器对象提供返回值,比如说:在foreach内部的每一次循环内,yield关键字用于终止当前循环。当希望获取一个IEnumerable类型的集合,而不想把数据一次性加载到内存,就可以考虑使用yield return实现"按需供给"。cl原创 2015-09-14 17:49:21 · 756 阅读 · 0 评论 -
HTTP 错误 401.2 - Unauthorized
功能视图->身份验证->全部禁用>开启"匿名身份验证"->编辑"选择应用程序池"标识。原创 2015-09-22 14:44:43 · 5107 阅读 · 0 评论 -
System.Web.Optimization找不到引用
如果在项目的程序集里找不到System.Web.Optimization,只能在NuGet中下载:Install-Package Microsoft.AspNet.Web.Optimization 回车即可!原创 2015-12-24 20:48:44 · 1351 阅读 · 0 评论 -
委托、匿名委托和Lamda表达式
委托public int Sum(int a, int b){ return a+b;}public delegate int SumMethod(int a,int b);public int ShowValue1(){ SumMethod sum1 = new SumMethod(Sum) return sum1(1,2);} 匿名原创 2014-01-15 15:52:20 · 1058 阅读 · 0 评论 -
C#连接Excel的连接字符串
在c#项目中导入Excel数据的时候,需要连接Excel的各个版本已满足需求,不得不做Excel各个版本的处理。string fileExt = Path.GetExtension(excelPath); string conn = ""; if (fileExt == ".xls") { conn = "Provider = Microsoft.Jet.OLEDB.4.0 ; Da原创 2016-05-26 10:30:19 · 7917 阅读 · 1 评论 -
System.Web.Optimization 合并压缩技术的使用(转载)
捆绑和压缩原理是:将多个css文件动态合并和压缩为一个css文件、多个js文件动态合并和压缩为一个js文件,如此达到减少浏览器对服务器资源文件的请求数量、缩小资源文件的尺寸来提高页面反应速度的目的。ASP.NET 4.5及以上版本支持此技术(Optimization)。 使用方法: 先nuget下载包Microsoft.AspNet.Web.Optimization,然后原创 2017-02-26 12:09:50 · 986 阅读 · 0 评论 -
对象初始化器和集合初始化器
public class Person { public Person() { } public int ID { get; set; } public string LastName { get; set; } public string FirstName { get; set; } }原创 2017-02-26 15:49:36 · 620 阅读 · 0 评论 -
向源代码管理注册此项目时出错。建议不要对此项目进行任何更改。
CCHR项目是从SVN上签到VSS的,项目打开提示如下错误。需要打开.csproj项目文件将含有关于SVN的配置节去掉即可。原创 2017-10-19 17:20:24 · 1133 阅读 · 0 评论 -
未能加载文件或程序集“K2CSC.DLL”或它的某一个依赖项。 不是有效的 Win32 应用程序。 (异常来自 HRESULT:0x800700C1)
原因分析:操作系统是64位的,但发布的程序引用了一些32位的dll,出现了兼容性问题。 解决方案:IIS—应用程序池—应用程序对应的程序池—高级设置—启用32位应用程序 :true。原创 2017-11-10 10:25:42 · 8687 阅读 · 0 评论 -
泛型中new()约束的用法
一、.NET中支持的类型参数约束有以下几种where T : struct T必须是一个结构类型where T : class T必须是一个类(class)类型,不能是结构(structure)类型where T : new() T必须要有一个无参构造函数where T : NameOfBaseC转载 2017-11-20 09:57:10 · 4910 阅读 · 0 评论 -
未能加载文件或程序集“EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个
Resolution of the dependency failed, type = "OperateCenter.ServiceContracts.ISysService", name = "(none)".Exception occurred while: while resolving.Exception is: FileLoadException - 未能加载文件原创 2018-01-03 13:14:03 · 3922 阅读 · 1 评论 -
C#中base关键字的几种用法
base其实最大的使用地方在面相对性开发的多态性上,base可以完成创建派生类实例时调用其基类构造函数或者调用基类上已被其他方法重写的方法。例如:2.1关于base调用基类构造函数public class A{ public A() { Console.WriteLine("Build A");转载 2018-01-04 10:29:52 · 1480 阅读 · 0 评论 -
单例设计模式
using Memcached.ClientLibrary;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ZY.Common{ public static c原创 2015-08-24 17:53:33 · 568 阅读 · 0 评论 -
Windows服务多线程同步淘宝房源
Windows服务多线程同步淘宝房源 /// 多线程发布房源信息 /// </summary> public void SyncHouse() { try { if (listEst != null) { int avg = listEst.Count / 2; star原创 2015-07-01 13:31:41 · 797 阅读 · 0 评论 -
C#如何在线程里调用带参数的方法
1、在类中定义方法Process() public class ProcessClass { public int start { get; set; } public int end{ get; set;2.在线程里调用方法int start=0;int end=10;ProcessClass A= new Proc原创 2015-07-01 21:11:31 · 1628 阅读 · 0 评论 -
SQL/LINQ/Lamda
SQLLINQLambdaSELECT *FROM HumanResources.Employeefrom e in Employeesselect eEmployees .Select (e => e)SELECT e.LoginID, e.JobTitleFROM HumanResour转载 2014-01-15 17:16:39 · 773 阅读 · 0 评论 -
关于HttpWebRequest和HttpWebResponse的两个自定义方法
public static string MyHttpGet(string Url, string postDataStr) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url + (postDataStr == "" ? "" : "?") + postDataStr);原创 2014-01-23 16:39:01 · 1522 阅读 · 0 评论 -
asp.net下载Excel模板和导入导出Excel功能
1.导入Excel protected void bt_Import_Click(object sender, EventArgs e) { if (!fu_Excel.HasFile) { Js.Alert(this.Page, "请您选择Excel文件!", false);原创 2014-01-23 15:56:19 · 3477 阅读 · 0 评论 -
asp.net(c#)发送邮件类和注意事项
using System; using System.Collections.Generic; using System.Text; using System.Net.Mail; using System.Configuration; public class Emails { public static bool Se原创 2014-01-23 16:22:11 · 1153 阅读 · 0 评论 -
Microsoft Visual Studio 2012旗舰版(VS2012中文版下载)官方中文版
Microsoft Visual Studio 2012 Ultimate旗舰版(VS2012中文版下载)是一个最先进的开发解决方案,它使各种规模的团队能够设计和创建出使用户欣喜的引人注目的应用程序。在Visual Studio 2012旗舰版(VS2012中文版)中您可以使用灵活敏捷的规划工具(如容量规划、任务板和积压工作管理)来按照您自己的进度实现增量开发技术和敏捷方法。使用高级建模、发现和体转载 2014-02-14 10:54:33 · 20517 阅读 · 1 评论 -
Razor 语法
Razor 语法http://www.w3chtml.com/aspnet/razor-syntax.html原创 2014-02-19 17:21:30 · 850 阅读 · 0 评论 -
C#的#if false #else #endif
#if FLAG xxx; //自己的命令1#else yyy; //自己的命令2#endif可以像理解普通代码中的if……else一样理解。只不过该if……else是属于“条件编译”(对于那块代码块需要执行,那块不需要而已)。原创 2014-03-04 13:20:02 · 3268 阅读 · 0 评论 -
C#泛型接口实例
泛型接口的类型参数要么已实例化,要么来源于实现类声明的类型参数!原创 2015-02-05 09:59:22 · 2733 阅读 · 0 评论 -
解决asp.net导出Excel报表时字符转成了数字科学计数法格式问题
编号015E258导出Excel后会自动转成数字科学计数法格式尝试着把sql查询语句中添加了前置单引号方式,但是导出来的数据前会有单引号,点击单元格后引号才会消失,这种方法不行。尝试在Excel中改变列的格式为文本,因为生成Excel的时候就已经是默认数字格式了,还是不行。尝试着在sql查询的时候数据前添加”中文全角的空格“,让他前置整个字符,结果导出来还是不行-_-!!!原创 2015-04-03 13:12:41 · 5815 阅读 · 0 评论 -
partial修饰符修饰的类叫部分类
partial是一个类修饰符,用于把类定义拆分为几个部分,便于代码管理,如class ClassA{void A(){;}void B(){;}}与partial class ClassA{void A(){;}}partial class ClassA{void B(){;}}是一样的原创 2014-08-12 12:10:31 · 1245 阅读 · 0 评论 -
C#将58同城商圈接口返回Json字符串反序列化成List对象类集合绑定DropdownList
/// /// 58同城商圈列表 /// protected void GetShopList() { string PostUrl = "http://www.58.com/api/local/LocalList"; string uid = "######"; string key = "######";原创 2015-04-27 11:10:03 · 2275 阅读 · 0 评论 -
IEnumerable/ICollection/IList/List继承关系
public interface IEnumerable : IEnumerablepublic interface ICollection : IEnumerable, IEnumerablepublic interface IList : ICollection, IEnumerable, IEnumerablepublic class List : ILi原创 2015-05-04 11:35:35 · 1260 阅读 · 0 评论 -
一款非常不错的asp.net图片处理类,自己用的时候需要做相应的修改(水印、剪裁、缩略图)
using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Web;using System.Drawing;using System.Drawing.Imaging;using System.Drawing.Drawing2D;using System.C原创 2015-06-17 10:48:05 · 1958 阅读 · 0 评论