摘要: 1.在web config 添加这个行代码<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>2.requestEncoding默认编码为 UTF-8,该编码在 Machine.config 文件(在安装 .NET Framework 时创建)的 globalization 节中指定。如果在 Machine.config 或 Web.config 文件中未指定请求编码,则编码默认为计算机的“区域选项”区域设置。在单服务器应用程序中,此属性和 responseEnco 阅读全文
posted @ 2012-01-06 12:34 sulin 阅读(380) 评论(0) 推荐(0)
摘要: 1.处理点所有的换行/// <summary>/// 去掉换行符 /// </summary> /// <param name="str"></param>/// <returns></returns>public string GetDeleteBR(string strinput){string p = "\\n|\r\n"; //数据库的的换行是\nstring returnstr = System.Text.RegularExpressions.Regex.Replace(s 阅读全文
posted @ 2012-01-06 12:28 sulin 阅读(550) 评论(0) 推荐(0)
摘要: dsoframer API:/*10.显示或隐藏修订内容ShowRevisions(long nNewValue)nNewValue = 0 则隐藏修订 = 1 则显示修订 *///显示修订留痕document.all.FramerControl1.ShowRevisions(1);//隐藏修订留痕 document.all.FramerControl1.ShowRevisions(0); /*11.插入合并文件, strFieldPath 文件路径,可以是http,ftp的路径 pPos = 0//当前鼠标位置1;文件开头2;文件末尾 pPos的第4位为1的时候,代表插入的是图片 InSer 阅读全文
posted @ 2011-12-30 23:01 sulin 阅读(505) 评论(0) 推荐(0)
摘要: 1.注册DSOFramer.ocx开始->运行->regsvr32 DSOFramer.ocx路径(DSOFramer.ocx 的具体位置如:E://DSOFramer.ocx) , 系统会提示DSOFramer.ocx中的2DSO的接口文档/* 1.新建 */ //新建Word document.all.FramerControl1.CreateNew("Word.Document");//新建Excel document.all.FramerControl1.CreateNew("Excel.Sheet");/* 2.打开文件 *///打 阅读全文
posted @ 2011-12-30 22:49 sulin 阅读(1033) 评论(0) 推荐(0)
摘要: /******************************* **功能:实现在一段字符串中查找某个字符或者字符串出现的位置 **作者:lin.su **时间:2011年10月17日23:02:02 **参数str:需要的目标字符串 **参数searchfor:在目标字符串中匹配的字符串或者字符 **参数count:需要在目标字符串出现次数 **调用示例:Tool.GetPositionByStr("lin.su",'s',1) return 4 *******************************/ GetPositionByStr:funct 阅读全文
posted @ 2011-12-30 20:47 sulin 阅读(205) 评论(0) 推荐(0)
摘要: 1.doc文档的查看是这样的需要转换成html,保存路径,直接打开html浏览2.应用Microsoft.Office.Interop.Word组件3.操作代码object filePath = Server.MapPath("doc文件相对路径"); object readOnly = true; object addToRecentFiles = false; object confirmConversion = false; object revert = true; object visible = false; object formate = WdSaveFor 阅读全文
posted @ 2011-12-30 19:35 sulin 阅读(506) 评论(0) 推荐(0)
摘要: 1.目前支持浏览器firefox,IE 在BODY, FRAMESET, window 对象上Onunload,onbeforeunload事件2.在什么情况下触发这两个事件: 关闭浏览器窗口; 点击返回,前进,刷新,一个前往其他页面的url连接的时候; 调用window事件触发 如click3.区别在于onbeforeunload在onunload之前执行,它还可以阻止onunload的执行。Onbeforeunload也是在页面刷新或关闭时调用,Onbeforeunload是正要去服务器读取新的页面时调用,此时还没开始读取;而onunload则已经从服务器上读到了需要加载的新的页面,在即将 阅读全文
posted @ 2011-12-10 21:54 sulin 阅读(413) 评论(0) 推荐(0)
摘要: 1.引用组件 using System.Net; using System.IO;2.下载数据 一:DownloadFileSystem.Net.WebClientwc = new System.Net.WebClient(); client.DownloadFile("http://www.baidu.com/", "E:\\baidu.txt"); 二:DownloadData System.Net.WebClient wc = new System.Net.WebClient(); byte[] bytes = wc.DownloadData(&q 阅读全文
posted @ 2011-12-05 22:48 sulin 阅读(465) 评论(0) 推荐(0)
摘要: 1.HTTP亦即Hpyer Text Transfer Protocal的缩写,它是现代互联网上最重要的一种网络协议,超文本传输协议位于TCP/IP协议的应用层,是一个面向 无连接、简单、快速的C/S结构的协议 。HTTP的工作过程大体上分连接、请求、响应和断开连接2..NET类库中提供了WebRequest和WebResponse就是利用这两个类实现的网络功能HttpWebRequest:HttpWebRequest 类对 WebRequest 中定义的属性和方法提供支持,也对使用户能够直接与使用 HTTP 的服务器交互的附加 属性和方法提供支持。 http://msdn.microsoft 阅读全文
posted @ 2011-12-04 22:15 sulin 阅读(329) 评论(0) 推荐(0)
摘要: 1.SubstringSubstring(startIndex); startIndexType: System.Int32The zero-based starting character position of a substring in this instance. string str="ABCDEFG"; str.Substring(2); // returns "CDEFG" str.Substring(7);//returns an empty string str.Substring(8);//Causes an ArgumentOut 阅读全文
posted @ 2011-11-29 23:15 sulin 阅读(286) 评论(0) 推荐(0)