2008年5月23日 星期五

FetionPlus beta2

I builded a Fetion addon to add 2 channels into Chinamobile Fetion by VS2008.
The code can be found at the SVN site .
And the build can be found at my download page .

This pack of fetion add Sina-Finance and Google Talk into the channels.

How to use:
Extract the files into your fetion installed directory and you can copy the ".lnk" file to anywhere.
After all, you can point the ".lnk" file's icon to run FetionPlus beta2.

2008年2月17日 星期日

Create this web log

建立这个日志。
I will publish news about all TOP projects here.
Here is a simple list of current TOP projects:
1)Top Widgets(https://topwidgets.googlecode.com/)
2)Top Runner All(https://sourceforge.net/projects/servclipse)
3)And I will hold all other simple library here.
The first will be "Top Proxy".
It is made for Top Widgets to realize SSO function.
I will update code soon.

某子,以下代码是一个典型的用户注册页,使用了AccessDataSource,请参考,注意.Net framework一定调到v2:
<%@ Page Language="C#" Title="Add new user" %>

<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data" %>

<script runat="server" type="text/C#">

    
void ButtonSubmit_Click(object sender, EventArgs e)
    {
        
//提交提示语, 需要翻译
        LabelFeedback1.Text = "Your name is:  " + TextBoxUsername.Text;
        LabelFeedback2.Text 
= "Your e-mail address is:  " + TextBoxEmail.Text;
        LabelFeedback3.Text 
= "Your address is:  " + TextBoxStreet.Text + " " + TextBoxSuburb + "," + DropDownListState.Text + " " + TextBoxPostcode.Text;
        LabelFeedback4.Text 
= "Your blog is:  " + TextBoxURL.Text;

        
//提交参数赋值
        UsersDataSource.InsertParameters[0].DefaultValue = TextBoxUsername.Text;
        UsersDataSource.InsertParameters[
1].DefaultValue = TextBoxPassword.Text;
        UsersDataSource.InsertParameters[
2].DefaultValue = TextBoxEmail.Text;
        UsersDataSource.InsertParameters[
3].DefaultValue = RadioButtonListGender.Text;
        UsersDataSource.InsertParameters[
4].DefaultValue = ListBoxAge.Text;
        UsersDataSource.InsertParameters[
5].DefaultValue = TextBoxStreet.Text;
        UsersDataSource.InsertParameters[
6].DefaultValue = TextBoxSuburb.Text;
        UsersDataSource.InsertParameters[
7].DefaultValue = DropDownListState.Text;
        UsersDataSource.InsertParameters[
8].DefaultValue = TextBoxPostcode.Text;
        UsersDataSource.Insert();
    }
    
</script>

<html>
<head>
    
<title></title>
    
<style type="text/css">
        
</style>
</head>
<body>
    
<form runat="server" id="form1">
    
<table>
    
<!--提示|输入|验证-->
    
<!--提示和验证错误消息需要翻译-->
        
<tr>
            
<td colspan="3" align="center">
                
<asp:Label ID="Label1" runat="server" Text="User Registration"></asp:Label>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelUsername" runat="server" Text="Username:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxUsername" runat="server"></asp:TextBox>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator runat="server" ID="ValidateUsername" ErrorMessage="<p><b>Please enter a valid username.</b>"
                    ControlToValidate
="TextBoxUsername">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelEmail" runat="server" Text="E-mail address:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxEmail" runat="server"></asp:TextBox>
            
</td>
            
<td>
                
<asp:RegularExpressionValidator ID="ValidateEmail2" runat="server" ControlToValidate="TextBoxEmail"
                    ValidationExpression
=".*@.*\..*" ErrorMessage="Invalid E-mail address." Display="Dynamic">
                
</asp:RegularExpressionValidator>
                
<asp:RequiredFieldValidator ID="ValidateEmail1" runat="server" ControlToValidate="TextBoxEmail"
                    ErrorMessage
="<p><br>Please enter valid e-mail address.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelPassword" runat="server" Text="Password:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxPassword" runat="server" TextMode="Password"></asp:TextBox>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator ID="ValidatePassword" runat="server" ControlToValidate="TextBoxPassword"
                    ErrorMessage
="<p><br>Please enter password.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelConPassword" runat="server" Text="Confirm password:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxConPassword" runat="server" TextMode="Password"></asp:TextBox>
            
</td>
            
<td>
                
<asp:CompareValidator ID="ValidateConPassword2" runat="server" ControlToValidate="TextBoxConPassword"
                    ControlToCompare
="TextBoxPassword" Type="String" Operator="Equal" ErrorMessage="<p><br>Two passwords do not match.</br>">
                
</asp:CompareValidator>
                
<asp:RequiredFieldValidator ID="ValidateConPassword1" runat="server" ControlToValidate="TextBoxConPassword"
                    ErrorMessage
="<p><br>Please confirm your password.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelGender" runat="server" Text="Gender:"></asp:Label>
            
</td>
            
<td>
                
<asp:RadioButtonList ID="RadioButtonListGender" runat="server">
                    
<asp:ListItem>Male</asp:ListItem>
                    
<asp:ListItem>Female</asp:ListItem>
                
</asp:RadioButtonList>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator runat="server" ID="ValidateGender" ControlToValidate="RadioButtonListGender"
                    ErrorMessage
="<p><br>Please select your gender.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelAge" runat="server" Text="Age:"></asp:Label>
            
</td>
            
<td>
                
<asp:ListBox ID="ListBoxAge" runat="server">
                    
<asp:ListItem>1-9</asp:ListItem>
                    
<asp:ListItem>10-19</asp:ListItem>
                    
<asp:ListItem>20-29</asp:ListItem>
                    
<asp:ListItem>30-39</asp:ListItem>
                    
<asp:ListItem>40-49</asp:ListItem>
                    
<asp:ListItem>50-59</asp:ListItem>
                    
<asp:ListItem>60 above</asp:ListItem>
                
</asp:ListBox>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator ID="ValidateAge1" runat="server" ControlToValidate="ListBoxAge"
                    ErrorMessage
="<p><br>Please enter your age.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelStreet" runat="server" Text="No.&Street:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxStreet" runat="server"></asp:TextBox>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator runat="server" ID="ValiteStreet" ControlToValidate="TextBoxStreet"
                    ErrorMessage
="<p><br>Please enter valid number and street.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelSuburb" runat="server" Text="Suburb:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxSuburb" runat="server"></asp:TextBox>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator ID="ValidateSuburb" runat="server" ControlToValidate="TextBoxSuburb"
                    ErrorMessage
="<p><br>Please enter valid suburb.</br>"></asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelState" runat="server" Text="State:"></asp:Label>
            
</td>
            
<td>
                
<!--需要替换为中国省份-->
                
<asp:DropDownList ID="DropDownListState" runat="server">
                    
<asp:ListItem>AL</asp:ListItem>
                    
<asp:ListItem>AK</asp:ListItem>
                    
<asp:ListItem>AZ</asp:ListItem>
                    
<asp:ListItem>AR</asp:ListItem>
                    
<asp:ListItem>CA</asp:ListItem>
                    
<asp:ListItem>CO</asp:ListItem>
                    
<asp:ListItem>CT</asp:ListItem>
                    
<asp:ListItem>DE</asp:ListItem>
                    
<asp:ListItem>FL</asp:ListItem>
                    
<asp:ListItem>GA</asp:ListItem>
                    
<asp:ListItem>HI</asp:ListItem>
                    
<asp:ListItem>ID</asp:ListItem>
                    
<asp:ListItem>IL</asp:ListItem>
                    
<asp:ListItem>IN</asp:ListItem>
                    
<asp:ListItem>IA</asp:ListItem>
                    
<asp:ListItem>KS</asp:ListItem>
                    
<asp:ListItem>KY</asp:ListItem>
                    
<asp:ListItem>LA</asp:ListItem>
                    
<asp:ListItem>ME</asp:ListItem>
                    
<asp:ListItem>MD</asp:ListItem>
                    
<asp:ListItem>MA</asp:ListItem>
                    
<asp:ListItem>MI</asp:ListItem>
                    
<asp:ListItem>MN</asp:ListItem>
                    
<asp:ListItem>MS</asp:ListItem>
                    
<asp:ListItem>MO</asp:ListItem>
                    
<asp:ListItem>MT</asp:ListItem>
                    
<asp:ListItem>NE</asp:ListItem>
                    
<asp:ListItem>NV</asp:ListItem>
                    
<asp:ListItem>NH</asp:ListItem>
                    
<asp:ListItem>NJ</asp:ListItem>
                    
<asp:ListItem>NM</asp:ListItem>
                    
<asp:ListItem>NY</asp:ListItem>
                    
<asp:ListItem>NC</asp:ListItem>
                    
<asp:ListItem>ND</asp:ListItem>
                    
<asp:ListItem>OH</asp:ListItem>
                    
<asp:ListItem>OK</asp:ListItem>
                    
<asp:ListItem>OR</asp:ListItem>
                    
<asp:ListItem>PA</asp:ListItem>
                    
<asp:ListItem>RI</asp:ListItem>
                    
<asp:ListItem>SC</asp:ListItem>
                    
<asp:ListItem>SD</asp:ListItem>
                    
<asp:ListItem>TN</asp:ListItem>
                    
<asp:ListItem>TX</asp:ListItem>
                    
<asp:ListItem>UT</asp:ListItem>
                    
<asp:ListItem>VT</asp:ListItem>
                    
<asp:ListItem>VA</asp:ListItem>
                    
<asp:ListItem>WA</asp:ListItem>
                    
<asp:ListItem>WV</asp:ListItem>
                    
<asp:ListItem>WI</asp:ListItem>
                    
<asp:ListItem>WY</asp:ListItem>
                    
<asp:ListItem>Out of USA</asp:ListItem>
                
</asp:DropDownList>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelPostcode" runat="server" Text="Postcode:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxPostcode" runat="server"></asp:TextBox>
            
</td>
            
<td>
                
<asp:RequiredFieldValidator ID="ValidatePostcode1" runat="server" ControlToValidate="TextBoxPostcode"
                    ErrorMessage
="<p><br>Please enter your postcode.</br>">
                
</asp:RequiredFieldValidator>
                
<asp:RangeValidator ID="ValidatePostcode2" runat="server" ControlToValidate="TextBoxPostcode"
                    MinimumValue
="10000" MaximumValue="99999" Type="Integer" ErrorMessage="<p><br>Please enter valid postcode.</br>">
                
</asp:RangeValidator>
            
</td>
        
</tr>
        
<tr>
            
<td>
                
<asp:Label ID="LabelURL" runat="server" Text="Personal Blog:"></asp:Label>
            
</td>
            
<td>
                
<asp:TextBox ID="TextBoxURL" runat="server">http://</asp:TextBox>
            </td>
            
<td>
                
<asp:RegularExpressionValidator ID="ValidateURL2" runat="server" ControlToValidate="TextBoxURL"
                    ValidationExpression
="http://.+(\..+)+" ErrorMessage="Invalid URL." Display="Dynamic">
                
</asp:RegularExpressionValidator>
                
<asp:RequiredFieldValidator ID="ValidateURL1" runat="server" ControlToValidate="TextBoxURL"
                    ErrorMessage
="<p><br>Please enter valid URL.</br>">
                
</asp:RequiredFieldValidator>
            
</td>
        
</tr>
        
<tr>
            
<td colspan="3" align="center">
                
&nbsp;
            
</td>
        
</tr>
        
<tr>
            
<td colspan="3" align="center">
                
<asp:Label ID="LabelFeedback1" runat="server"></asp:Label>
            
</td>
        
</tr>
        
<tr>
            
<td colspan="3" align="center">
                
<asp:Label ID="LabelFeedback2" runat="server"></asp:Label>
            
</td>
        
</tr>
        
<tr>
            
<td colspan="3" align="center">
                
<asp:Label ID="LabelFeedback3" runat="server"></asp:Label>
            
</td>
        
</tr>
        
<tr>
            
<td colspan="3" align="center">
                
<asp:Label ID="LabelFeedback4" runat="server"></asp:Label>
            
</td>
        
</tr>
        
<tr>
            
<td colspan="3" align="center">
                
<asp:Button ID="ButtonSubmit" runat="server" Text="Submit" OnClick="ButtonSubmit_Click" />
                
<!--                
                    数据库名:Users.mdb
                    表名:UsersInfo
                    表结构:id(自动编号即可)    username    password    email    gender    age    street    suburb    state    postcode
                
-->
                
<asp:AccessDataSource ID="UsersDataSource" runat="server" DataFile="Users.mdb" SelectCommand="SELECT [username], [password], [email], [gender], [age], [street], [suburb], [state], [postcode], [id] FROM [UsersInfo]"
                    InsertCommand
="INSERT INTO [UsersInfo] ([username], [password], [email], [gender], [age], [street], [suburb], [state], [postcode]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)">
                    
<InsertParameters>
                        
<asp:Parameter Name="username" Type="String" />
                        
<asp:Parameter Name="password" Type="String" />
                        
<asp:Parameter Name="email" Type="String" />
                        
<asp:Parameter Name="gender" Type="String" />
                        
<asp:Parameter Name="age" Type="String" />
                        
<asp:Parameter Name="street" Type="String" />
                        
<asp:Parameter Name="suburb" Type="String" />
                        
<asp:Parameter Name="state" Type="String" />
                        
<asp:Parameter Name="postcode" Type="String" />
                    
</InsertParameters>
                
</asp:AccessDataSource>
            
</td>
        
</tr>
    
</table>
    
</form>
</body>
</html>