創(chuàng)建完相應(yīng)的用戶名,密碼控件之后,輸入以下代碼:
10年積累的網(wǎng)站建設(shè)、成都網(wǎng)站建設(shè)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先做網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有博野免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
Imports System.Data.OleDb
Public Class Form1
Private Sub cmdok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdok.Click
Dim m_username As String
Dim m_userpwd As String
Dim cmd_result As MsgBoxResult
Dim m_da As New OleDbDataAdapter
Dim m_ds As New DataSet
Dim m_command As New OleDbCommand
Dim strsql As String
m_username = txtusername.Text
m_userpwd = txtuserpwd.Text
strsql = " select * from user_info where username='" m_username "' and userpwd='" m_userpwd "'"
OleDbConnection1.Open()
m_command.CommandType = CommandType.Text
m_command.CommandText = strsql
m_command.Connection = OleDbConnection1
m_da.SelectCommand = m_command
m_da.Fill(m_ds, "user_info")
If m_ds.Tables("user_info").Rows.Count 0 Then
cmd_result = MsgBox("歡迎登錄", MsgBoxStyle.OKOnly, "提示")
Else
MsgBox("登錄失敗,請(qǐng)確認(rèn)用戶名和密碼")
End If
End Sub
End Class
下面這段代碼,是我用來(lái)計(jì)算每個(gè)月存500元進(jìn)銀行,連續(xù)30年,最后連本帶利能有多少錢。這里面涉及復(fù)利計(jì)算。界面中右邊的文本框用來(lái)輸出每一次計(jì)算的結(jié)果。
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
1、首先,錄入新的預(yù)定時(shí)間,肯定各有一個(gè)開始時(shí)間和一個(gè)結(jié)束時(shí)間
2、用當(dāng)前錄入的開始時(shí)間到系統(tǒng)中找,例如
select * from 會(huì)議表 where 開始時(shí)間= 當(dāng)前錄入的開始時(shí)間 and 當(dāng)前錄入的開始時(shí)間=結(jié)束時(shí)間, 如果返回記錄大于1,那么說(shuō)明當(dāng)前選擇的開始時(shí)間已被其他會(huì)議占用,需要重新選擇,同理
3、用當(dāng)前錄入的結(jié)束時(shí)間到系統(tǒng)中找,例如
select * from 會(huì)議表 where 開始時(shí)間= 當(dāng)前錄入的結(jié)束時(shí)間 and 當(dāng)前錄入的結(jié)束時(shí)間=結(jié)束時(shí)間, 如果返回記錄大于1,那么說(shuō)明當(dāng)前選擇的結(jié)束時(shí)間已被其他會(huì)議占用,需要重新選擇
思路有了,如何友好提示操作用戶,就看你自己的了,你中間可以虛擬加上每個(gè)會(huì)議的整理時(shí)間,例如:會(huì)議開始前的10分鐘,算作會(huì)議預(yù)備時(shí)間,也算作本次會(huì)議需要占用的時(shí)間,結(jié)束后的10分鐘,也算作本次會(huì)議需要占用的時(shí)間,我覺得,這樣更人性化些