随笔分类 - .NET
摘要:今天用.NET4.0开发 设置validateRequest="false" 居然晕死 网上别人的解决方法在全局级别(Web.config中)设置<configuration> <system.web> <httpRuntime requestValidationMode="2.0">
阅读全文
摘要:先解码。接着转换为纯文本,用这段代码:public static string HtmlToText(string source) { string result; //remove line breaks,tabs result = source.Replace("\r", " "); result = result.Replace("\n", " "); result = result.Replace("\t", " "); //remove the header res
阅读全文
摘要:引入js文件:在Demo KingEditor文件夹下<script src="KingEditor/kindeditor.js" type="text/javascript"></script><script type="text/javascript"> KE.show({ id: 'content2',// 注意这里 resizeMode: 1, allowPreviewEmoticons: false, allowUpload: false, items: ['fon
阅读全文
摘要:最近在iteye网站发布不了,只能在这里做个笔记不知道各位高手还有没有其他方法获取listbox的多选值 for (int i = 0; i < ListBox1.Items.Count; i++) { ListItem listItem = ListBox1.Items[i]; if (listItem.Selected == true) { //str += listItem.Text; } }
阅读全文
摘要:好不好用你说的算,至于你用不用,不关我的事,反正我是用了。下载方式,打开你的vs,工具-扩展管理器--输入以下indent guides搜索。之后你懂了。安装效果如下;每对花括号都有一个虚线对应,以后再多花括号再也不会出现头晕晕感觉。说明:好像只支持2010版本vs,补充多一点:工具---选项--可以设置虚线的颜色、大小。。。。还有很多多功能,欢迎大家去摸索,补充。
阅读全文
摘要:源代码完全公开,欢迎大家灌水!部分代码如下1. //Response.ContentType是输出流的 HTTP MIME 类型 //Response.ContentType --- word文件 //application/vnd.ms-excel --- excel文件 //更多格式请参考http://walleyekneel.iteye.com/blog/979524 HttpContext.Current.Response.Charset = "utf-8"; HttpContext.Current.Response.ContentEncoding = System
阅读全文
摘要:1.配置文件部分节点 <connectionStrings> <add name="connstr" connectionString="dffsafds"/> </connectionStrings>获取string s = ConfigurationManager.ConnectionStrings["connstr"].ToString();2.配置文件部分节点<appSettings><add key="conn" value="~/App_D
阅读全文