vb转c#中的几个问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 09:41:49
下面的&=怎么转为C#,还有MySelect.Style(Key) ,MySpan.Style("color"), MyText.Style("width")怎么转为C#,回答得越详细越好,最好分析一下程序。
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)

Message.InnerHtml &= "<h5>Accessing Styles...</h5>"

Message.InnerHtml &= "The color of the span is: " & MySpan.Style("color") & "<br>"
Message.InnerHtml &= "The width of the textbox is: " & MyText.Style("width") & "<p>"

Message.InnerHtml &= "MySelect's style collection is: <br><br>"

Dim Keys As IEnumerator

Keys = MySelect.Style.Keys.GetEnumerator()

Do While (Keys.MoveNext())

Dim Key As String
Key = CStr(Keys.Current)
Message.InnerHtml &= "<li> 

&换成+
dim KEY as string 等类似的换成 string key;
Sub Page_Load(Src As Object, E As EventArgs) 等 c#系统会自动生成 就不说了

去掉 end sub 每句后面加分号“;”

看看行不行,运行的起吗?

如果是()前面的单词有错误 则把()改为[]

<script language="C#" runat="server">