20
2012
05

asp中检测代理地址和得到真实地址

ASP中的Request.ServerVariables("HTTP_X_FORWARDED_FOR")可以得到用户的代理IP。如果用户用了代理,那么这个值就不会为空。反之。就是空的

 

那么,我们就可以在网页加载时检测用户的代理IP是不是为空。程序如下:

UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
...

20
2012
05

DataSet与Xml文件之间的转化、对XML的基本操作

        #region xml文件内容转化为DataSet
        /// <summary>
        /// xml文件内容转化为DataSet
        /// </summary>
...

20
2012
05

.net mssql自己封装的 备份/还原 数据库方法

        #region 数据库备份 BackupData
        /// <summary>
        /// 数据库备份
        /// </summary>
...

20
2012
05

mssql视图和触发器的操作

///sql查询分析器里面操作

///删除视图
if exists(select table_name from information_schema.views where table_name='v_user')
drop view v_user

///创建视图
create view v_user
...

20
2012
05

C++/c#修改hosts文件

#include<iostream>
#include<fstream>
#include <WTypes.h>
#include <Winbase.h>
using namespace std;
int main()
{
ofstream outf;
char * lpFileName="C:\\Windows\\System32\\drivers\\etc\\hosts";
...

20
2012
05

[转载]mssql 生成‘批量Insert数据的sql语句’的存储过程

(含中文插入处理)
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spGenInsertSQLHan]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[spGenInsertSQLHan]
GO

SET QUOTED_IDENTIFIER ON
GO
...

20
2012
05

js格式化显示当前时间

<script type="text/javascript">
//    function settime() {
//        var mytime = document.getElementByIdx_x_x("mytime");
...

20
2012
05

C#中npoi操作Excel[版本1.2.1读写2003格式]

//npoi操作Exce的测试(你的Excel文件必须在运行程序的电脑(服务器)上,网站中尤其要注意这点)

//先引用npoi的dll文件

//用到的dll下载地址: npoidll.zip
...

20
2012
05

.net一般处理程序ashx生成验证码

//第一种

using System;
using System.Collections.Generic;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
using System.Web.SessionState;

...

20
2012
05

C#对文件的字节加密/解密-可逆

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
...