摘要:private string getWebresourceFile1(string url) { WebClient myWebClient = new WebClient(); byte[] myDataBuffer = myWebClient.DownloadData(url); string SourceCode = ...
阅读全文
随笔分类 - Asp.net
摘要:关键问题是 SqlCommand.CommandTimeout 和 SqlConnection.ConnectionTimeout 的区别。连接字符串中的超时只是设置的 SqlConnection.ConnectionTimeout 的值,而不是设置的 SqlCommand.CommandTimeout 的值。
阅读全文
摘要:string gameUrl =http://www.baidu.com string fileName = HttpUtility.UrlEncode("百度.url"); context.Response.ContentType = "APPLICATION/OCTET-STREAM"; context.Response.AddHeader("Content-Disposition", "at...
阅读全文
摘要:using System;using IWshRuntimeLibrary;class Program{ static void Main(string[] args) { //创建快捷方式 //建立对象 WshShell shell = new WshShell(); //生成快捷方式文件,指定路径及文件名 IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut("c:\\" + "my.lnk"); //快捷方式指向的目标 shortcut.TargetPath = "e:\\S
阅读全文
摘要://首先引用Com下 Windows Script Host Object Modelusing System.Runtime.InteropServices; using IWshRuntimeLibrary;private void AddShortcut() { try { string mysite = "http://www.baidu.com"; //创建收藏夹快捷方式 string fav = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Favorites) + "
阅读全文
摘要:导入COM组件Windows Script Host Object Modelusing IWshRuntimeLibrary;WshShell shell = new WshShell();IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut( Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\" + "Allen's Application.lnk" );shortcut.Targ
阅读全文
摘要:IIS 添加网站显示错误消息“无更多可用的内存以更新安全信息”解决方法 IIS在添加新的网站时,网站未添加,且显示错误消息“无更多可用的内存以更新安全信息此错误的原因是由于没有为 HTTP.sys 分配足够的非页面缓冲池内存。默认情况下,IIS 根据可用的物理内存量来自动确定可创建的网站数量。例如,在内存为 64 MB 的计算机上,非页面缓冲池内存值设置为 1...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.IO;namespace Test{ public class WebsResponse { /// <summary> /// 模拟提交 /// </sum...
阅读全文
摘要:xmlDocument.Load Ds.ReadXML 提示错误,错误信息如下: 十六进制值 0x0B 是无效的字符错误 产生原因是xml文件中包含低位非打印字符造成的 处理方法:在产生xml文件的时候,过滤低位非打印字符 public static string ReplaceLowOrderASCIICharacters(string tmp) { StringBuilder info = n...
阅读全文
摘要:Chart 控件 for vs2008的安装 1.下载4个文件:(1)dotnetfx35setup.exe(2)MSChart_VisualStudioAddOn.exe(3)MSChartLP_chs.exe(4)MSChart.exe2.分别安装(1)dotnetfx35setup.exe(2)MSChart_VisualStudioAddOn.exe(3)MSChartLP_chs.exe...
阅读全文
摘要:1 将系统时间转换成UNIX时间戳 DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,1,1)); DateTime dtNow = DateTime.Parse(DateTime.Now.ToString()); TimeSpan toNow = dtNow.Subtract(dtStart); s...
阅读全文