vb.net和c#语法比较
1.变量声名
C# 语法
int x;
String s;
String s1, s2;
Object o;
Object obj = new Object();
public String name;
VB语法
Dim x As Integer
Dim s As String
Dim s1, s2 As String
Dim o 'Implicitly Object
Dim obj As New Object()
Public name As String
2语句
C#:
Response.Write("中文c#技术站");
VB:
Response.Write("中文c#技术站")
3.注释语句
//中文c#技术站
/*
欢迎访问
,
中文c#技术站
*/
VB:
'中文c#技术站
4.获得URL 传递的变量
C#:
String s = Request.QueryString["Name"];
String value = Request.Cookies["key"];
VB:
Dim s, value As String
s = Request.QueryString("Name")
value = Request.Cookies("Key").Value
|