标题:为什么&&在c# 2005编译器里被看做是是运算符?
只看楼主
testcrack
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-1-22
 问题点数:0 回复次数:1 
为什么&&在c# 2005编译器里被看做是是运算符?

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;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.textusername.Text = "";
this.textuserpwd.Text = "";
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{

}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{

}
protected void btnLogin_Click(object sender, EventArgs e)
{
if (this.textusername.Text = "a" && this.textuserpwd.Text = "a"[color=00FF00]//就是这行
{
this.lbMessage.Text = "登入成功";
}
else
{
this.lbMessage.Text = "登入失败";
}
}
}[/color]


为什么&&在c# 2005编译器里被看做是是运算符?而在c#2003编译器里就不会报错?我想要达到"和"的效果应该用什么关键字?

搜索更多相关主题的帖子: using 运算符 System Web 编译 
2006-01-24 12:12
marer
Rank: 2
等 级:新手上路
威 望:3
帖 子:928
专家分:0
注 册:2005-7-18
得分:0 
改为:
if(this.textusername.Text=="a" && this.textuserpwd.Text=="a")

public class 人生历程 extends Thread{public void run(){while(true){努力,努力,再努力!!;Thread.sleep(0);}}}
2006-01-24 12:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-43858-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.090330 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved