vb.net复制文件 vbnet复制文件( 二 )


Private Sub Command1_Click()
Dim m_objFSO As New FileSystemObject
Dim objFolderAs Scripting.Folder'文件夹对象
Dim objFileAs Scripting.File'文件对象
Set objFolder = m_objFSO.GetFolder("c:/test")
For Each objFile In objFolder.Files
Dim filenames() As String
filenames = Split(objFile.Name, ".")
If filenames(0) = "cmd" Then
FileCopy objFile.Path, "c:/TestCMD/""newName."filenames(1)
End If
Next objFile
End Sub
-----------------------------------这是VB.net的--------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim files() As String
files = System.IO.Directory.GetFiles("C:/test")
For i = 0 To files.Length - 1
Dim filenames() As String
filenames = files(i).Substring(files(i).LastIndexOf("\") + 1).Split(".")
If filenames(0) = "cmd" Then
FileCopy(files(i), "c:/TestCMD/""newName."filenames(1))
End If
Next
End Sub
VB.NET怎么复制文件到剪切板 , 不是复制文件内容!例如vb.net复制文件,把文件"E:\新建文件夹\a.txt"复制到剪贴板
CreateObject("Shell.Application").NameSpace("E:\新建文件夹").ParseName("a.txt").InvokeVerb "复制(C)"
【vb.net复制文件 vbnet复制文件】关于vb.net复制文件和vbnet复制文件的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读