View Mode: Normal | Article List

Send Mail in ASP.NET 2.0

[ 2007-01-17 23:17:21 | Author: sunrise_chen ]
public static void SendSMTPEMail(string strSmtpServer, string strFrom, string strFromPass, string strto, string strSubject, string strBody)
{
System.Net.Mail.SmtpClient client = new SmtpClient(strSmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(strFrom, strFromPass);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
...

Read More...

Send Mail in ASP.NET 1.x

[ 2007-01-17 23:16:35 | Author: sunrise_chen ]
private void Page_Load(object sender, System.EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
...

Read More...
曾经心血来潮,想做一个推箱子游戏,但后来因为时间关系,始终没有完成,以下是写了一半的代码,只实现了地图初始化,没有加上动作控制。
<script language=javascript>
  var R = 10, C = 10;

  var MAPS = [];
  MAPS[0] = "0000000000000111000000012100000001011110011130321001203511100111131000000012100000001110000000000000";
  MAPS[1] = "1111100000100510000010331011101030101210111011121001100002100100010010010001111001111100000000000000";
  MAPS[2] = "00000000000111111
...

Read More...
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft System Monitor">
<META NAME="Author" CONTENT="sunrise_chen@msn.com">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD><BODY>
<OBJECT ID="DISystemMonitor1" WIDTH="100%" HEIGHT="100%"
CLASSID="CLSID:C4D2D8E0-D1DD-11CE-940F-008029004347">
 <PARAM NAME="Counter00001.Path" VALUE="\\SUNRISE\Memory\Available MBytes">
...

Read More...

ASP封成DLL

[ 2006-10-08 11:09:31 | Author: sunrise_chen ]
ASP封成DLL

服务器端组件

首先,服务器端的组件要有别于客户端的组件.客户端的组件是通过网络传输,依靠HTML来起作用.而且只能在IE上有用.但是服 务器端的组件是运行在服务器端,它在服务器上执行各种操作.因此,所有的浏览器都能享用,它依*的是服务器而不是浏览器.

当IIS被请求执行一个ASP程序,它首先会在ASP文件中找到<%%>标签之间的代码,并且执行它(也可以是<script runat=server></script>之间的代码).如果这个ASP程序在先前被调用过,那么它就会用 内存中的编译过的程序来向用户返回HTML代码,如果没有,那么它就重新编译.这里ASP就比CGI多一点速度优势,因为CGI 是每一个请求都使用一个线程.这样就大大消耗了服务器的资源.

想不想你写的程序自己就能在IIS运行!?!现在你就行了!使用VB5(当然现在是VB6了),你就能建立DynamicLin ...

Read More...

JScript on the server: GetRows example

[ 2006-10-08 10:43:31 | Author: sunrise_chen ]
JScript on the server: GetRows example

by Peter Johnson
Translated by Sunrise_Chen <sunrise_chen@msn.com>

Who should read this article: Programmers writing ASP in JScript instead of VBScript
谁适合读这篇文章: 用JScript替代VBScript写ASP的程序员。

I've found many sites that advocate the use of GetRows, including LearnASP (which also has GetRows functionality on steroids available in JScript in the form of ...

Read More...

Some useful Regular Expression

[ 2006-10-08 10:40:10 | Author: sunrise_chen ]
常用的正则表达式 collected by Sunrise_Chen

Require : /.+/
Email : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
Phone : /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/
Mobile : /^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/
Url : /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/
IdCard : /^\d{15}(\d{2}[A-Za-z0-9])?$/
Currency : /^\d+(\.\d+)?$/
...

Read More...