随笔分类 - ASP.NET
摘要:转载:http://dev.mjxy.cn/a-Calendar-calendar-control-multiple-dates-selection.aspx//处理Calendar1的SelectionChanged事件 protected void Calendar1_SelectionChanged(object sender, EventArgs e) { List<DateTime> lst = SelectDate; if (lst.Contains(Calendar1.SelectedDate)) { lst.Remove(Calendar1.SelectedDate
阅读全文
摘要:转载地址:http://dev.mjxy.cn/a-How-to-customize-the-IHttpModule.aspx使用自定义的 IHttpModule 方法可以实现自己想要的url重写功能。1. 自定义类 HttpModule 继承 IHttpModule实现接口的Init方法,在方法中处理BeginRequest事件。public class HttpModule : IHttpModule { #region IHttpModule 成é员± public void Dispose() { } public void Init(HttpApplication
阅读全文
摘要:转载:http://dev.mjxy.cn/a-How-to-customize-the-IHttpHandler.aspx定义处理HttpHandler 让ModuleX加载的时候稍有延迟。public class DelayDownloadHandler :IHttpHandler { public bool IsReusable { get { return true; } } public void ProcessRequest(HttpContext context) { string path = context.Server.MapPath(context.Request.Pat
阅读全文
摘要:转自:http://dev.mjxy.cn/a-Installation-ckeditor.aspx1. 下载ckeditorhttp://ckeditor.com/2. 解压后将ckeditor和ckfinder目录复制到项目中3. 修改配置文件ckeditor/config.js config.language = 'zh-cn'; //中文 config.uiColor = '#BFEE62'; //编辑器颜色 config.font_names = '宋体;楷体_GB2312;新宋体;黑体;隶书;幼圆;微软雅黑;Arial;Comic Sans
阅读全文
摘要:转自:http://dev.mjxy.cn/a-FCKeditorNET-custom-upload-directory-and-file-names-automatically-generated.aspx使用用FCKeditor的上传功能,我们会发现上传后的文件名和本地的是一样的,不会自动更改文件名,这样有时候本地是中文文件名的时候就不是太好了。下面是我对FCKeditor.NET源文件的修改,使上传文件自动生成随机文件名,而且上传目录根据当前时间归类,这样方便管理! 下面使用的是FCKeditor.NET 2.6.3 版。1、根据当前时间设置上传目录打开FileBrowser\\Conf
阅读全文
摘要:转载:http://dev.mjxy.cn/a-Create-pdf-using-Apache-NFOP.aspx//**************************************// Name: Create in memory PDF documents in ASP.NET using Apache NFOP// Description:The sample demonstrates how to create PDF documents in memory using the open source Apache NFOP(http://sourceforge.net/p
阅读全文
摘要:转载:http://dev.mjxy.cn/a-402.aspxSystem.IO.Stream iStream = null; // Buffer to read 10K bytes in chunk: byte[] buffer = new Byte[10240]; // Length of the file: int length; // Total bytes to read: long dataToRead; // Identify the file to download including its path. string filepath = @"E:\softwar
阅读全文
摘要:转自: http://dev.mjxy.cn/a-Download-the-file-to-stream-download-hide-the-real-path.aspx以流的方式下载文件,隐藏实际的下载路径view sourceprint?01string path = Server.MapPath("~/UploadFiles/" + "a.doc"); 02System.IO.FileInfo file = new System.IO.FileInfo(path); 0304Response.Clear(); 05Response.AddHeade
阅读全文
摘要:1DateTime thisDate1 = new DateTime(2011, 6, 10); 02Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + "."); 0304DateTimeOffset thisDate2 = new DateTimeOffset(2011, 6, 10, 15, 24, 16, 05TimeSpan.Zero); 06Console.WriteLine("The current date and tim
阅读全文

浙公网安备 33010602011771号