◆●用了is为什么还要用as?Textbox temp=null;foreach(Control control in this.Controls){if(control is textbox) temp= control as Textbox; }为什么前面用了is检查了 这里还要用as呢?is检查后 不就确定了类型吗?确定了类
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/26 16:30:45
![◆●用了is为什么还要用as?Textbox temp=null;foreach(Control control in this.Controls){if(control is textbox) temp= control as Textbox; }为什么前面用了is检查了 这里还要用as呢?is检查后 不就确定了类型吗?确定了类](/uploads/image/z/12685747-67-7.jpg?t=%E2%97%86%E2%97%8F%E7%94%A8%E4%BA%86is%E4%B8%BA%E4%BB%80%E4%B9%88%E8%BF%98%E8%A6%81%E7%94%A8as%3FTextbox+temp%3Dnull%3Bforeach%28Control+control+in+this.Controls%29%7Bif%28control+is+textbox%29+temp%3D+control+as+Textbox%3B+%7D%E4%B8%BA%E4%BB%80%E4%B9%88%E5%89%8D%E9%9D%A2%E7%94%A8%E4%BA%86is%E6%A3%80%E6%9F%A5%E4%BA%86+%E8%BF%99%E9%87%8C%E8%BF%98%E8%A6%81%E7%94%A8as%E5%91%A2%3Fis%E6%A3%80%E6%9F%A5%E5%90%8E+%E4%B8%8D%E5%B0%B1%E7%A1%AE%E5%AE%9A%E4%BA%86%E7%B1%BB%E5%9E%8B%E5%90%97%3F%E7%A1%AE%E5%AE%9A%E4%BA%86%E7%B1%BB)
xRJA}n$[WzUlW
42]H~T)s
WM|ow}Inf~w9,*Ehzd0'd"Kk^i
{~)I-F"'rLzD$|Ʊ=!l"
L%m1Zpd]kh="k~wC l`P
p
9P+]ǜ<~&c`[JZ)ҙ5JV|Q|7L#Jz%(jd19Hvs߅auݐIJY)zAݏJ4zPP8K++j"Gyѳ
j
◆●用了is为什么还要用as?Textbox temp=null;foreach(Control control in this.Controls){if(control is textbox) temp= control as Textbox; }为什么前面用了is检查了 这里还要用as呢?is检查后 不就确定了类型吗?确定了类
◆●用了is为什么还要用as?
Textbox temp=null;
foreach(Control control in this.Controls)
{
if(control is textbox) temp= control as Textbox;
}
为什么前面用了is检查了 这里还要用as呢?is检查后 不就确定了类型吗?确定了类型 那就不用as转换了啊 直接temp= control 这样不行吗?
◆●用了is为什么还要用as?Textbox temp=null;foreach(Control control in this.Controls){if(control is textbox) temp= control as Textbox; }为什么前面用了is检查了 这里还要用as呢?is检查后 不就确定了类型吗?确定了类
is 可以看做是==的符号,相当于比对
as是赋值
2个单词,在C#中的含义是不同的
◆●用了is为什么还要用as?Textbox temp=null;foreach(Control control in this.Controls){if(control is textbox) temp= control as Textbox; }为什么前面用了is检查了 这里还要用as呢?is检查后 不就确定了类型吗?确定了类
My voice is as hoarse as a raven 还有为什么用AS AS 被这个弄晕S了
He is as a good boy as Tim.为什么要用as a good boy as?
China as she is,is very different from China as she is twenty years ago为什么两个地方都用as she isChina _______,is very different from China ______ twenty years ago.A.as is;as wasB.as she is;as she isC.as she;as sheD.as it is;as it is为什
I think this book is as interesting as that one 为什么要用is在那儿
here is coming the professer and writer as well as his friends为什么用is呢
He's shaving at eight o'clock.句中有动词shaving了 为什么还要用be动词is去掉is.改为He shaving at eight o'clock.
Mo Yan is konwn .a writer.为什么中间用as
He looks as if he is ill为什么用if 、
为什么经过了沉淀、过滤之后,还要用活性炭吸附
I don't think swimming is as interesting as hikingI don‘t think swimming is as interesting as hiking这里swim和hike 为什么用现在进行时
it is hot today ,though not as hot as yesterday为什么hot 用圆形
Jay Chou is famous as a talented singer.为什么不用for,而用as呢?
she is as tall as her mother if not taller 后面为什么用taller
bob is not (as careful as)tom 括号里面的词用对了吗 为什么
The weather is not as well as it was yesterday.为什么用well?
he is at least as tall as you,为什么用least?……
can he buy the car?he is as poor as( can) be.为什么用can