copy

 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
 

你可能感兴趣的:(c,String,Integer)