2009/01/31
It looks like for the moment at least, all Google results are failing the malware checks and being listed with a warning "This site may harm your computer," including all pages from Google themselves. Users trying to visit pages at search results will only be able to proceed via manual manipulation of the search result link to remove the Google click-through (which is also broken). Until Google fixes this bug, it looks Google web search is useless.
Tags:
2009/01/30
2009/01/24
    int 关键字表示一种整型,是32位的,它的 .NET Framework 类型为 System.Int32。

    (int)表示使用显式强制转换,是一种类型转换。当我们从 int 类型到 long、float、double 或decimal 类型,可以使用隐式转换,但是当我们从 long 类型到 int 类型转换就需要使用显式强制转换,否则会产生编译错误。

    Int32.Parse()表示将数字的字符串转换为32 位有符号整数,属于内容转换。
    我们一种常见的方法:public static int Parse(string)。
    如果 string 为空,则抛出 ArgumentNullException 异常;
    如果 string 格式不正确,则抛出 FormatException 异常;
    如果 string 的值小于 MinValue 或大于 MaxValue 的数字,则抛出 OverflowException 异常。

    Convert.ToInt32() 则可以将多种类型(包括 object 引用类型)的值转换为 int 类型,因为它有许多重载版本[2]:
    public static int ToInt32(object);
    public static int ToInt32(bool);
    public static int ToInt32(byte);
    public static int ToInt32(char);
    public static int ToInt32(decimal);
    public static int ToInt32(double);
    public static int ToInt32(short);
    public static int ToInt32(long);
    public static int ToInt32(sbyte);
    public static int ToInt32(string);

    (int)和Int32.Parse(),Convert.ToInt32()三者的应用举几个例子:    

    例子一:

    long longType = 100;
    int intType = longType;       // 错误,需要使用显式强制转换
    int intType = (int)longType; //正确,使用了显式强制转换

    例子二:

    string stringType = "12345";
    int intType = (int)stringType;                 //错误,string 类型不能直接转换为 int 类型
    int intType = Int32.Parse(stringType);   //正确
Tags:
2009/01/22
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlConnection con = DB.createConnection();
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from province",con);
            SqlDataReader sdr = cmd.ExecuteReader();
            ddlProvince.DataSource = sdr;
            ddlProvince.DataTextField = "proName";
            ddlProvince.DataValueField = "proID";
            ddlProvince.DataBind();
            sdr.Close();
            SqlCommand cmdCity = new SqlCommand("select * from city where proID=" + ddlProvince.SelectedValue,con);
            sdr = cmdCity.ExecuteReader();
            ddlCity.DataSource = sdr;
            ddlCity.DataTextField = "cityName";
            ddlCity.DataValueField = "cityID";
            ddlCity.DataBind();
            sdr.Close();
            con.Close();

        }

    }
    protected void ddlProvince_SelectedIndexChanged(object sender, EventArgs e)
    {
        string proID =ddlProvince.SelectedValue;
        SqlConnection con = DB.createConnection();
        con.Open();
        SqlCommand cmd = new SqlCommand("select * from city where proID=" + proID, con);
        SqlDataReader sdr = cmd.ExecuteReader();
        ddlCity.DataSource = sdr;
        ddlCity.DataTextField = "cityName";
        ddlCity.DataValueField = "cityID";
        ddlCity.DataBind();
        sdr.Close();
        con.Close();

    }
}
Tags:
2009/01/18
    
      如果你在自己的网页中插入JS代码浏览时弹出错误,又不知那里错误,不想修改的话,可以加下面这个容错代码,这样就不会弹出了。

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide
function killErrors() {
return true;
}
window.onerror = killErrors;
// -->
</SCRIPT>

Tags:
2009/01/16
      
      头:header
  内容:content/container
  尾:footer
  导航:nav
  侧栏:sidebar
  栏目:column
  页面外围控制整体布局宽度:wrapper
  左右中:left right center
  登录条:loginbar
  标志:logo
  广告:banner
  页面主体:main
  热点:hot
  新闻:news
  下载:download
  子导航:subnav
  菜单:menu
  子菜单:submenu
  搜索:search
  友情链接:friendlink
  页脚:footer
  版权:copyright
  滚动:scroll
  内容:content
  标签页:tab
  文章列表:list
  提示信息:msg
  小技巧:tips
  栏目标题:title
  加入:joinus
  指南:guild
  服务:service
  注册:regsiter
  状态:status
  投票:vote
  合作伙伴:partner
Tags: ,
2009/01/12
shyshy

http://blog.wenxueba.net/snake.html

绿色方块表示食物,红色表示蛇。
注意:不能走相反方向。
Tags: , ,
2009/01/08
  以后千万不要再考FLASH和PS了,很累。
  其实FLASH和PS如果你学得非常好,还是很有前途的。
  辅导了宿舍两个晚上,虽然自己也学了很多东西,不过真是累人,一个一个说过去。
  网络构建最后一题,考试前我是似而非的解答被误解为标准答案传的全班都是,大哥,那是我写的,上周写的,还有错。为了避免第二天考试出现同一答案,考场上我使劲改答案,改IP,这次考试最无奈的事。
  我们宿舍这次考试平均成绩绝对大幅度提高,英语翻译被我猜中一题,老师没说的那题。
  明天回家咯。
  开始过宅男生活……
  其他学校没像我们这么快就放假了,真是爽。
  家实在美妙。
  coolcoolcool
Theme by Marshal. Powered by Bo-Blog 2.1.1 ReleaseCode detection by Bug.Center.Team