下面這段代碼,是我用來計(jì)算每個(gè)月存500元進(jìn)銀行,連續(xù)30年,最后連本帶利能有多少錢。這里面涉及復(fù)利計(jì)算。界面中右邊的文本框用來輸出每一次計(jì)算的結(jié)果。
成都創(chuàng)新互聯(lián)公司服務(wù)項(xiàng)目包括昭化網(wǎng)站建設(shè)、昭化網(wǎng)站制作、昭化網(wǎng)頁制作以及昭化網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,昭化網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到昭化省份的部分城市,未來相信會繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
? Dim nianxian As Integer '年限變量
? Dim dingcun As Integer '定存變量
? Dim fuli_big As Long '大復(fù)利
? Dim fuli_small As Long '小復(fù)利
? Dim i As Integer '循環(huán)變量
? Dim DATAstring As String '數(shù)據(jù)字符串
? nianxian = Val(年限_TextBox.Text)
? dingcun = Val(定存_TextBox.Text)
? DATAstring = ""
? For i = 1 To nianxian
? ? ? fuli_small = dingcun * (1 + 0.1875)
? ? ? dingcun = fuli_small
? ? ? fuli_big = fuli_big + fuli_small
? ? ? DATAstring = DATAstring + "[" + Trim(Str(i)) + "]" + Str(fuli_big) + Chr(13) + Chr(10)
? ? ? 'DATAstring = DATAstring + "[" + Trim(Str(i)) + "]" + Str(fuli_small) + Chr(13) + Chr(10)
? Next
? 'fuli_big = fuli_small
? TextBox1.Text = DATAstring
? 結(jié)果_TextBox.Text = Str(fuli_big) + "元"
End Sub
Dim url As String=" 網(wǎng)址"
Dim httpReq As System.Net.HttpWebRequest
Dim httpResp As System.Net.HttpWebResponse
Dim httpURL As New System.Uri(url)
httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)
httpReq.Method = "GET"
httpResp = CType(httpReq.GetResponse(), HttpWebResponse)
httpReq.KeepAlive = False ' 獲取或設(shè)置一個(gè)值,該值指示是否與
Internet資源建立持久連接。
Dim reader As StreamReader = _
New StreamReader(httpResp.GetResponseStream,
System.Text.Encoding.GetEncoding(-0))
Dim respHTML As String = reader.ReadToEnd() 'respHTML就是網(wǎng)頁源代碼
說明:1.共有4個(gè)文本框其,其中三個(gè)是填入或輸出數(shù)據(jù)的(名稱分別是:txta txtb txtc),剩下的那個(gè)是符號(txtd)2.共7個(gè)按鈕,4個(gè)是符號按鈕,一個(gè)計(jì)算,一個(gè)清零.這是我弄的程序”袖珍計(jì)算器”代碼也是自己編寫的,代碼如下:通用聲明Dim j As Integer '定義j為整型
Private Sub Text1_Change()End SubPrivate Sub Command1_Click()
txtfuhao.Text = "+" '將”+”顯示到文本框txtfuhao.Text中
End SubPrivate Sub Command2_Click()
txtfuhao.Text = "-" ''將”-”顯示到文本框txtfuhao.Text中
End SubPrivate Sub Command3_Click()
txtfuhao.Text = "×" '將”×”顯示到文本框txtfuhao.Text中
End SubPrivate Sub Command4_Click()
txtfuhao.Text = "÷" 將”÷”'顯示到文本框txtfuhao.Text中
End Sub
Private Sub Command5_Click()
Dim a, b, c As Integer
a = Val(txta.Text) '將txta.Text里的內(nèi)容轉(zhuǎn)化為數(shù)值型,然后再賦給a
b = Val(txtb.Text) '將txtb.Text里的內(nèi)容轉(zhuǎn)化為數(shù)值型,然后再賦給b
If txtfuhao.Text = "+" Then '運(yùn)算過程
c = a + b '運(yùn)算過程
ElseIf txtfuhao.Text = "-" Then '運(yùn)算過程
c = a - b '運(yùn)算過程
ElseIf txtfuhao.Text = "÷" Then '運(yùn)算過程
c = a / b '運(yùn)算過程
ElseIf txtfuhao.Text = "×" Then '運(yùn)算過程
c = a * b '運(yùn)算過程
Else
j = MsgBox("您輸入的符號不正確", vbOKOnly, "錯誤信息")
End If
txtc.Text = c '將運(yùn)算結(jié)果c輸出到文本框txtc中
End SubPrivate Sub Command6_Click()
txta.Text = "" '將空字符輸入到文本框內(nèi)(刷新)
txtb.Text = "" '將空字符輸入到文本框內(nèi)(刷新)
txtc.Text = "" '將空字符輸入到文本框內(nèi)(刷新)
txtfuhao.Text = "" '將空字符輸入到文本框內(nèi)(刷新)
End SubPrivate Sub Command7_Click()
End '結(jié)束程序
End SubPrivate Sub Form_Load()End Sub
GRANT { { SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER }
[,...] | ALL [ PRIVILEGES ] }
ON [ TABLE ] tablename [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT { { USAGE | SELECT | UPDATE }
[,...] | ALL [ PRIVILEGES ] }
ON SEQUENCE sequencename [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
ON DATABASE dbname [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
ON FUNCTION funcname ( [ [ argmode ] [ argname ] argtype [, ...] ] ) [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON LANGUAGE langname [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] }
ON SCHEMA schemaname [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT { CREATE | ALL [ PRIVILEGES ] }
ON TABLESPACE tablespacename [, ...]
TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ]
GRANT role [, ...] TO username [, ...] [ WITH ADMIN OPTION ]
希望對你有幫助