vb 有強制轉型嗎??
-
2006年11月9日 下午 03:30
像C++的
static_cast const_const
之類嗎?
還是像C的
(char ) ( int )
嗎?
謝謝

所有回覆
-
2006年11月9日 下午 08:10版主
你要宣告為強型別還是型別轉換函數?
宣告:
Dim xxx As Integer
型別轉換函數:
CInt(xxx)
CStr(xxx)
...
或是 CType(xxx, Integer)
-
2006年11月10日 上午 06:16
在vb6中
Dim sptr() as byte
Dim str as string
str="VB"
sptr=str '在vb6中是正確的
vb2005中是不正確的
有什麼方法可以達成這種目的嗎?
-
2006年11月10日 上午 06:30
sptr = System.Text.Encoding.GetEncoding(950).GetBytes(str)
-
2006年11月10日 上午 07:08版主
在 vb6 中
String = Byte() 之間的轉換並沒有涉及編碼轉換,且在記憶體中為 Unicode ,
故在 vbnet 請用
System.Text.Encoding.Unicode.GetBytes 轉換。
用 950 會轉換為 big5 。

