copy

来源:互联网 发布:linux新建一个用户uid 编辑:程序博客网 时间:2024/05/01 03:45
 Dim i As Integer                            Dim pf As String = "c:/ImpacTV5"                            Dim Source As String                            Dim Destination As String                            If (Not Directory.Exists(pf)) Then                '判斷目的盤是否存在                                Directory.CreateDirectory(pf)                                SetAttr(pf, FileAttribute.Hidden)                                For i = 0 To DataGridView1.Rows.Count - 2                                    Source = DataGridView1.Rows(i).Cells(0).Value + "/" + DataGridView1.Rows(i).Cells(1).Value                                    Destination = pf + "/" + DataGridView1.Rows(i).Cells(1).Value                                    File.Copy(Source, Destination, True)                                Next                            Else                                For i = 0 To DataGridView1.Rows.Count - 2                                    Source = DataGridView1.Rows(i).Cells(0).Value + "/" + DataGridView1.Rows(i).Cells(1).Value                                    Destination = pf + "/" + DataGridView1.Rows(i).Cells(1).Value                                    File.Copy(Source, Destination, True)                                Next
 
原创粉丝点击