1、首先在電腦中找到并打開(kāi)VB軟件,找到一句輸出的函數(shù)。
創(chuàng)新互聯(lián)2013年開(kāi)創(chuàng)至今,公司以成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、系統(tǒng)開(kāi)發(fā)、網(wǎng)絡(luò)推廣、文化傳媒、企業(yè)宣傳、平面廣告設(shè)計(jì)等為主要業(yè)務(wù),適用行業(yè)近百種。服務(wù)企業(yè)客戶成百上千家,涉及國(guó)內(nèi)多個(gè)省份客戶。擁有多年網(wǎng)站建設(shè)開(kāi)發(fā)經(jīng)驗(yàn)。為企業(yè)提供專業(yè)的網(wǎng)站建設(shè)、創(chuàng)意設(shè)計(jì)、宣傳推廣等服務(wù)。 通過(guò)專業(yè)的設(shè)計(jì)、獨(dú)特的風(fēng)格,為不同客戶提供各種風(fēng)格的特色服務(wù)。
2、然后在其數(shù)組變量中,套上一個(gè)Str函數(shù)。
3、這里注意函數(shù)的關(guān)鍵字,是沒(méi)有區(qū)分大小寫(xiě)的。
4、然后函數(shù)是可以多個(gè)嵌套使用。
5、最后點(diǎn)擊運(yùn)行按鈕,這樣就可以成功運(yùn)行測(cè)試,如下圖所示,轉(zhuǎn)換就完成了。
明白你的意思了,只要是字母都會(huì)轉(zhuǎn)換成數(shù)字,幫你寫(xiě)好了("usernane"和 "pasward" 我這里寫(xiě)成 "username" 和" password")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim username, password As String
Dim temp As Long
Dim r As String = ""
Dim v As String = TextBox1.Text
For Each c In v.ToString
If IsNumeric(c) Then
r = c
Else
r = ((Asc(c) - 65).ToString("00"))
End If
Next
username = r
temp = username * 3 - 500
password = CStr(temp)
TextBox2.Text = password
End Sub
Dim byts1() As Byte = {255, 255, 0, 0}
'4位16進(jìn)制數(shù)組轉(zhuǎn)Integer
Dim value As Integer = BitConverter.ToInt32(byts1, 0)
'Integer轉(zhuǎn)4位16進(jìn)制數(shù)組()
Dim byts2() As Byte = BitConverter.GetBytes(value)
Private Sub Text2_Change() '大寫(xiě)金額轉(zhuǎn)換成阿拉伯?dāng)?shù)字金額
Dim i As Integer
Dim j As Integer
Dim myint As Integer
Dim myint1 As Integer
Dim mydoub As Double
Dim mystr As String
Dim mystr1 As String
Dim mystr2 As String
Dim mystr3 As String
Dim mystr4 As String
Dim money As Long
Dim money1 As Integer
Dim money2 As Long
mystr = Text2.Text
myint = InStr(mystr, ".")
If myint = 0 Then
mystr = Text2.Text
Else
mystr3 = Right(Text2.Text, Len(Text2.Text) - myint)
If mystr3 "" Then '轉(zhuǎn)換小數(shù)位
mystr4 = Left(mystr3, 1)
mystr3 = Right(mystr3, Len(mystr3) - 1)
If mystr4 "0" Then
mystr2 = mystr2 + setdata(Val(mystr4)) + "角"
End If
If mystr3 "" Then
mystr4 = Left(mystr3, 1)
mystr2 = mystr2 + setdata(Val(mystr4)) + "分"
End If
End If
mystr = Left(Text2.Text, myint - 1)
End If
j = Len(mystr)
For i = 1 To Len(mystr) '轉(zhuǎn)換整數(shù)位
money2 = Left(mystr, i)
money1 = Right(money2, 1)
If money1 = 0 Then
If j = 5 Then
If Right(mystr1, 1) "萬(wàn)" Then mystr1 = mystr1 "萬(wàn)"
Else
If Right(mystr1, 1) "零" And Right(money, j) 0 Then mystr1 = mystr1 "零"
End If
Else
mystr1 = mystr1 setdata(money1) + chang(j)
End If
j = j - 1
Next i
Text1.Text = mystr1 "元" mystr2 '顯示大寫(xiě)
End Sub