22
2012
05

关于session超时、网址里有未知字符的问题

   session本来是个不稳定的东西,经常会被丢失,本来用cookie不错,但又不想对程序做改动。查了查资料,找到了下面一段:

     由于Asp.net程序是默认配置,所以Web.Config文件中关于Session的设定 默认的是下面这个:运行后后面会自动加一串字符 ,不好看,

...

21
2012
05

asp.net发送邮件代码

      今天测试了gmail的邮箱能发出去,其它的我测试是发不出去。

  #region 发送邮件的函数
        /// <summary>
        /// 发送邮件函数Gmail
...

20
2012
05

asp.net 中显示文件夹下的文件,并有链接地址的例子

using System;
using System.Configuration;
using System.Data.SqlClient;
using System.IO;
using System.Web;

 

   protected void Page_Load(object sender, EventArgs e)
...

20
2012
05

.Net Global.asax、伪静态等功能实现

//第一种方法,Global文件重写

 protected void Application_Start(object sender, EventArgs e)
       {
...

20
2012
05

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

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

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

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;
...

20
2012
05

c#对ftp进行操作

 FtpClient类下载 :FtpClient.zip

 

客户端使用:

第一种使用WebClient

...