首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2010年5月19日

摘要: ASP.NET探针获取IP Request.ServerVariables["LOCAL_ADDR"].ToString() 获取域名 Request.ServerVariables["SERVER_NAME"].ToString() 获取语言 Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"].ToString() 获取端口 Request.ServerVariables["SERVER_PORT"].ToString() IIS版本 Request.ServerVar 阅读全文

posted @ 2010-05-19 18:07 达奇 阅读(301) 评论(0) 推荐(1) 编辑

摘要: 操作Cookie/// <summary> /// 保存一个Cookie /// </summary> /// <param name="CookieName">Cookie名称</param> /// <param name="CookieValue">Cookie值</param> /// <param name="CookieTime">Cookie过期时间(小时),0为关闭页面失效</param> public void SaveC 阅读全文

posted @ 2010-05-19 17:47 达奇 阅读(299) 评论(0) 推荐(1) 编辑

摘要: 在数据库编程中我们经常用到连接字符串,针对不同的数据库有不同的连接字符串方法1.新建一个文本文件,把后缀名改成*.udl,双击打开按照提示完成里面的操作,然后测试连接,成功后关闭,在用记事本打开,呵呵,里面就有连接字符2.http://www.connectionstrings.com/ 阅读全文

posted @ 2010-05-19 17:46 达奇 阅读(231) 评论(0) 推荐(1) 编辑

摘要: 开始---运行---键入 regedit 注册表打开后,展开至 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify 在右边的窗格中把 IconStreams 和 PastIconsStream 的值删除。 然后同时按下DEL+ALT+CTRL键,或或者右击任务栏/任务管理器,打开任务管理器,在进程标签中选择结束EXPLORER进程。 然后,单击任务管理器的应用程序标签,点击新建任务按钮,在出来的对话框中输入EXPLORER,确定既可。重新打开 customize notifiction 阅读全文

posted @ 2010-05-19 17:36 达奇 阅读(853) 评论(0) 推荐(1) 编辑

摘要: 比较两个DataSet,并产生增量数据/// <summary> /// 比较两个DataSet,并产生增量数据 /// </summary> /// <param name="oldDataSet">原始DataSet</param> /// <param name="nowDataSet">现有DataSet</param> /// <param name="primaryKey">原始DataSet和现有DataSet Tables[0]的主键& 阅读全文

posted @ 2010-05-19 17:34 达奇 阅读(574) 评论(2) 推荐(2) 编辑

摘要: 查询数据库所有表名并插入XML #region 把查出来的表存起来 try { conn.Open(); SqlCommand comm = new SqlCommand("select name from sysobjects where type='U'", conn); dr = comm.ExecuteReader(); for (int i = 0; i < j; i++) { while (dr.Rea... 阅读全文

posted @ 2010-05-19 17:33 达奇 阅读(217) 评论(0) 推荐(1) 编辑

摘要: 网页复制保留版权JSdocument.body.oncopy=function(){ event.returnValue=false; var t=document.selection.createRange().text; var s="\r\n本文来源于 达奇-方向比努力更重要 http://dachie.cnblogs.com \r\n 转载请保留版权"; clipboardData.setData('Text','\r\n'+t+'\r\n'+s+'\r\n');}把以上javascript代码 放到一 阅读全文

posted @ 2010-05-19 17:29 达奇 阅读(278) 评论(0) 推荐(1) 编辑

摘要: 算法归纳递归法转换整数为字符void convert(int n){int t;if((t=n/10)!=0)convert(t);putch(n%10+'0');}判断素数int isPrime(int n){int i;for(i=2;i<n/2;i++)if(n%i==0) return 0;return 1;}求闰年if((year%4==0&year%100!=0)||(year%400)==0)printf("%d is a leap year",year);elseprintf("%d is not a leap yea 阅读全文

posted @ 2010-05-19 17:26 达奇 阅读(195) 评论(0) 推荐(1) 编辑

摘要: C#操作注册表using Microsoft.Win32; public void SetStartPage(string StartPage) { RegistryKey rk0 = Registry.CurrentUser; RegistryKey rk1 = rk0.OpenSubKey("Software", true); RegistryKey rk2 = rk1.OpenSubKey("Microsoft", true); RegistryKey rk3 = rk2.OpenSubKey("Internet Exp... 阅读全文

posted @ 2010-05-19 17:26 达奇 阅读(204) 评论(0) 推荐(1) 编辑

摘要: 简单MD5加密string strmd5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");//str 是传进来的值strmd5 即 加密后的md5值了 阅读全文

posted @ 2010-05-19 17:25 达奇 阅读(262) 评论(0) 推荐(1) 编辑

摘要: C#洗牌using System;using System.Diagnostics;using System.Collections;namespace Dachie{ class Program { static void Main(string[] args) { //初始化牌局 int[] array = new int[54]; for (int i = 0; i < array.Length; i++) { array[i... 阅读全文

posted @ 2010-05-19 13:35 达奇 阅读(170) 评论(0) 推荐(1) 编辑

摘要: 判断文件夹大小using System;using System.Collections.Generic;using System.Text;using System.IO;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { string Path = @"D:\Program Files\神鬼传奇"; long dt1 = DateTime.Now.ToFileTime(); C... 阅读全文

posted @ 2010-05-19 10:18 达奇 阅读(390) 评论(0) 推荐(1) 编辑