- 分享
- 0
- 人气
- 7
- 主题
- 13
- 帖子
- 1837
- UID
- 76124
- 积分
- 2113
- 阅读权限
- 20
- 注册时间
- 2007-5-6
- 最后登录
- 2018-4-22
- 在线时间
- 1487 小时
|
你们要从基础学咯
ok 我这边给你们的是 .net 的 写法
基础是 几个
c# 是 case sensitivity 的 S != s
vb.net 是没有分的 S = s
注解 或 marking
c#
一行的
// this is c#
多行的
/* this
is
C#
*/
vb.net
' this is vb.net
REM this is vb.net
==============================
c# 是以 ; 来区分是不是 下一行了
vb 直接 enter
看语法
c#
==============================
string A;
string B = A ;
// 一行的写法
mystring = mystring1 + mystring2 + mystring3;
// 两行的写法
mystring = mystring1 + mystring2 +
mystring3;
//三行的写法
mystring = mystring1 +
mystring2 +
mystring3;
==============================
c# 只要没 ; 就是当成同一行。
vb.net
==============================
dim A as string
dim B as string = A
' 一行的写法
mystring = mystring1 + mystring2 + mystring3
' 两行的写法
mystring = mystring1 + mystring2 + _
mystring3
' 三行的写法
mystring = mystring1 + _
mystring2 + _
mystring3
==============================
vb.net 的只要enter 就是下一行咯 只能用 _ 来 接下一行是同行
block structure
c# 的是
{ }
==============================
if (a == b)
{
'abc
}
public bool goodday()
{
'abc
}
==============================
vb.net
end if end case end sub end function
==============================
if a = b then
'abc
End if
public function goodday() as boolean
'abc
end function
资料类型 data type
Size (bytes) | Visual Basic.net | C#.net | Common Runtime Language | Value Range | 01 | Byte | byte | System.Byte | 0 to 255 | 01 | (Not Implemented) | sbyte | System.Sbyte | -128 to 127 | 02 | Boolean | bool | System.Boolean | True or False only | 02 | Char | char | System.Char | 0 to 65535 | 02 | Short | short | System.Int16 | -32,768 to 32,767. | 02 | (Not Implemented) | ushort | System.UInt16 | 0 to 65535 | 04 | Integer | int | System.Int32 | -2,147,483,648 to 2,147,483,647 | 04 | (Not Implemented) | uint | System.Uint32 | 0 to 4294967295 | 04 | Single | float | System.Single | -3.4028235E+38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.4028235E+38 for positive values. | 04 | Object | object | System.Object | Any type can be stored in a variable of type Object. | 08 | Date | DateTime | System.DateTime | 0:00:00 on January 1, 0001 through 11:59:59 PM on December 31, 9999. | 08 | Long | long | System.Int64 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. | 08 | (Not Implemented) | ulong | System.UInt64 | 0 to 18446744073709551615 | 08 | Double | double | System.Double | -1.79769313486231570E+308 to -4.94065645841246544E-324 for negative values; 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values. | 16 | Decimal | decimal | System.Decimal | 0 to +/-79,228,162,514,264,337,593,543,950,335 with no decimal point;0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest nonzero number is +/-0.0000000000000000000000000001 (+/-1E-28). | Varies | structure | struct | System.ValueType | Each member of the structure has a range determined by its data type and independent of the ranges of the other members. | Varies | String | string | System.String | 0 to approximately 2 billion Unicode characters |
[ 本帖最后由 goodday 于 2008-12-7 11:35 AM 编辑 ] |
|