1月16

Private Sub Command1_Click()
             label1.Text = ""
             label1.Text = GetChinaMoney(Text1.Text)
End Sub

Private Sub Form_Load()
          Text1.MaxLength = 16
           Text1.Text = ""
           label1.Text = ""
         Text1.Text = "987654321"

End Sub


-----------------------------Module1.bas---------------------------------------------------------




Public Function GetChinaMoney(ByVal strNumber) As String
Dim a() As String
Dim s1 As String, s2 As String
Dim l1 As String
Dim s3 As String
Dim strEng As String


strEng2Ch = "零壹贰叁肆伍陆柒捌玖"


If Not IsNumeric(strNumber) Then
If Trim(strNumber) <> "" Then MsgBox "无效的数字"
GetChinaMoney = ""

Exit Function
End If

l1 = InStr(strNumber, ".")
If l1 <> 0 Then
s1 = Left(strNumber, l1 - 1)
s2 = Mid(strNumber, l1 + 1)
Else
s1 = strNumber
s2 = "0"
End If

s1 = Dig2Chinese_pb(s1)

s3 = ""
If s2 <> 0 Then
For i = 1 To Len(s2)
If i = 1 Then s3 = s3 & Mid(strEng2Ch, Val(Mid(s2, i, 1)) + 1, 1) & "角"
If i = 2 Then s3 = s3 & Mid(strEng2Ch, Val(Mid(s2, i, 1)) + 1, 1) & "分"
If i = 3 Then s3 = s3 & Mid(strEng2Ch, Val(Mid(s2, i, 1)) + 1, 1) & "厘"
If i = 4 Then s3 = s3 & Mid(strEng2Ch, Val(Mid(s2, i, 1)) + 1, 1) & "毫"
Next
End If

GetChinaMoney = s1 & "圆" & s3


End Function


Public Function Dig2Chinese_pb(strEng As String) As String

Dim intLen As Integer, intCounter As Integer
Dim strCh As String, strtempCh As String
Dim strSeqCh1 As String, strSeqCh2 As String
Dim strEng2Ch As String
Dim sTemp As String
Dim i As Integer


Dim iWanBit As Integer
Dim iYiBit As Integer
Dim iWanYiBit As Integer


Dim sFoward As String


iWanBit = 0: iYiBit = 0: iWanYiBit = 0
sFoward = StrReverse(strEng)


For i = 1 To Len(sFoward)
Dim val1 As Long

val1 = Val(Mid(sFoward, i, 1))
If i >= 5 And i <= 8 Then
If iWanBit = 0 Then
If val1 <> 0 Then iWanBit = i
End If
End If


If i >= 9 And i <= 12 Then
If iYiBit = 0 Then
If val1 <> 0 Then iYiBit = i
End If
End If


If i >= 13 And i <= 16 Then
If iWanYiBit = 0 Then
If val1 <> 0 Then iWanYiBit = i
End If
End If


Next


If Not IsNumeric(strEng) Then
If Trim(strEng) <> "" Then MsgBox "无效的数字"
Dig2Chinese_pb = ""

Exit Function
End If

If Len(strEng) > 15 Then
MsgBox "数字位数太长"
Dig2Chinese_pb = ""

Exit Function

End If

strEng2Ch = "零壹贰叁肆伍陆柒捌玖"
strSeqCh1 = " 拾佰仟 拾佰仟 拾佰仟 拾佰仟"
strSeqCh2 = " 万亿兆"

'转换为表示数值的字符串
strEng = CStr(CDec(strEng))

'len
intLen = Len(strEng)

'change to chinese
For intCounter = 1 To intLen
strtempCh = Mid(strEng2Ch, Val(Mid(strEng, intCounter, 1)) + 1, 1)


If strtempCh = "零" And intLen <> 1 Then
' If Mid(strEng, intCounter + 1, 1) = "0" Or (intLen - intCounter + 1) Mod 4 = 1 Then


'若之后一个也是零,或在最后,则不显示"零"
If Mid(strEng, intCounter + 1, 1) = "0" Or intCounter = intLen Then
strtempCh = ""
End If
Else
'添加位 拾佰仟
If strtempCh <> "零" Then strtempCh = strtempCh & Trim(Mid(strSeqCh1, intLen - intCounter + 1, 1))

End If



'添加位 "万"(5-8),"亿"(9-12),"万亿"(13-16)
' iWanBit = 0: iYiBit = 0: iWanYiBit = 0
If intCounter = Len(strEng) + 1 - iWanBit Then strtempCh = strtempCh & "万"
If intCounter = Len(strEng) + 1 - iYiBit Then strtempCh = strtempCh & "亿"
If intCounter = Len(strEng) + 1 - iWanYiBit Then strtempCh = strtempCh & "万亿"


'组成汉字
strCh = strCh & Trim(strtempCh)

Next

Dig2Chinese_pb = strCh
End Function
1月16


Public Declare Function RasEnumConnections Lib "RasApi32.dll" _

 Alias "RasEnumConnectionsA" (lpRasCon As Any, _

 lpcb As Long, lpcConnections As Long) As Long

Public Declare Function RasGetConnectStatus Lib "RasApi32.dll" _

 Alias "RasGetConnectStatusA" (ByVal hRasCon As Long, _

 lpStatus As Any) As Long

1月16
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Const SWP_NOMOVE = &H2 '不更动目前视窗位置
Const SWP_NOSIZE = &H1 '不更动目前视窗大小
Const HWND_TOPMOST = -1 '设定为最上层
Const HWND_NOTOPMOST = -2 '取消最上层设定
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
1月16

ASCII码对照表

18:51V B 源码  From: 本站原创
ASCII是AmericanStandardCodeforInformationInterchange的缩写,

用来制订计算机中每个符号对应的代码,这也叫做计算机的内码(code)。

每个ASCII码以1个字节(Byte)储存,从0到数字127代表不同的常用符号,

例如大写A的ASCII码是65,小写a则是97。由于ASCII字节的七个位,最高位并不使用,

所以后来又将最高的一个位也编入这套内码中,成为八个位的延伸ASCII(ExtendedASCII)码,

这套内码加上了许多外文和表格等特殊符号,成为目前常用的内码。

Tags:
1月16
一、换零钱
哥哥结婚叫我去换50张20的rmb发小红包用。
拿了1k去银行换,sb态度极其不好的说“没有,不能换给你”
态度实在恶劣啊。我十分凶恶的反问“你再说一次”家伙很牛的说“就是没有”
我说“你=着”sb说“你威胁我啊”
我拿了身份证说“开户,存1k”.
结束了,我说“再提20”连着提了二次20。
sb说“侬萨意思啊?”
“cn闹钞票,闹50趟再销户不来三啊”
sb灰溜溜的换了50张擦刮里新额20元白我,贱!!!
1月16
不知该逃避还是装作坚强 无奈的坚强更容易受伤害 ...

你有你的梦想,我有我的追求,两条平行线永远不会交融

多少梦 多少过往 多少期待

留一份柔情的慰藉淡淡的萦绕心间

我深深地信任着你 信任着我们当初的约定

如同我信任地老天荒的亘古永
Tags:
1月16

世界很多无奈

18:36杂七杂八  From: 本站原创
1、宽容

  一只小猪、一只绵羊和一头乳牛,被关在同一个畜栏里。有一次,牧人捉住小猪,它大声号叫,猛烈地抗拒。绵羊和乳牛讨厌它的号叫,便说:「他常常捉我们,我们并不大呼小叫。小猪听了回答道:「捉你们和捉我完全是两回事,他捉你们,只是要你们的毛和乳汁,但是捉住我,却是要我的命呢!

  立场不同、所处环境不同的人,很难了解对方的感受;因此对别人的失意、挫折、伤痛,不宜幸灾乐祸,而应要有关怀、了解的心情。要有宽容的心!
Tags:
1月16

MM羞语录尴尬事

18:35开心一刻  From: 本站原创
1、刚才办公室MM问我为什么另一个MM能玩的游戏在她的机器上要S机。答曰,可能显卡驱动不行。MM遂要求帮助下载最新版,并安装。答曰,我有什么好处。MM说:“最多我让你玩一会儿好了!”0.01秒后,桌子上、椅子上全看不到人了,除了那个MM。。。
2、高中班里有个女生姓焦,一日和她打个赌,什么赌忘了,她问:“你输了怎么办?”答曰:“我输了我跟你姓焦。”声音洪亮,结果全班暴笑10分钟。

3、 一次一个女同事过来对我说:“我要上传!”我说:“你上床关我什么事情!”她很恼火的说:“我就是要上传,我要,我要,你今天不让我上传,我就不理你了,哼!”看她那愤怒的样子,我只好说:“好吧!是你自己动手还是我帮你?”她回答:“你帮我吧!”
Tags:
分页: 72/75 第一页 上页 67 68 69 70 71 72 73 74 75 下页 最后页 [ 显示模式: 摘要 | 列表 ]