meida
小學生
離線
文章: 1
|
vb資料備份的程式碼請大大幫我改一下 看vb書寫的但是套用在vb。net卻不能用 有那幾個程式語法要修改的呢?請大大幫我改一下謝謝!
Private Sub drive1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles drive1.SelectedIndexChanged Dir1.Path = drive1.Drive End Sub Private Sub Dir1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dir1.SelectedIndexChanged File1.Path = Dir1.Path End Sub Private Sub B1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B1.Click If List1.right.(Dir1.Path) = "\" Then List1.Items.Add(Dir1.Path & File1.FileName) Else List1.Items.Add(Dir1.Path & "\" & File1.FileName) End If End Sub Private Sub B2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B2.Click Dim i As Integer For i = List1.Items.Count - 1 To 0 Step -1 If List1.SelectedItems(i) Then List1.Items.Remove(i) End If Next End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim I, intTotallength_Fiename, intlength_filename As Integer Dim strtarget_filename As String For I = 0 To List1.MultiColumn - 1 intTotallength_Fiename = Len(List1.(I)) intlength_filename = InStrRev(List1.LIST(I), "\") If right.(Text1.Text, 1) = "\" Then strtarget_filename = Text1.Text & Right.List1.Items(I),intTotallength_Fiename - intlength_filename) Else strtarget_filename = Text1.Text & "\" & Right.(List1.LIST(I), intTotallength_Fiename - intlength_filename) End If FileCopy(List1.LIST(I), strtarget_filename) Next End Sub
Private Sub B3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B3.Click If Timer1.Enabled = False Then Timer1.Enabled = True B3.caption = "停止備份檔案" Else tmer1.enable = False B3.caption = "開始備份檔案" End If End Sub End Class
|