在vb6中使用相对路径复制文件 [英] copying file using relative path in vb6

查看:114
本文介绍了在vb6中使用相对路径复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友
我是萨法拉兹(Sarfaraz).首先,我要感谢所有帮助我解决了有关vb6的疑问的成员.谢谢

今天,我想使用vb6中的相对路径将安装程序安装的数据库从一个位置复制到另一个位置.
我正在做的是以下代码,该代码已成功运行,但在c中使用了文本文件,因此可以将其保存在任何位置.

Dear friends
I am Sarfaraz. First of all i would like to thank all the members who have helped me in solving my so many queries regarding vb6. Thank you

Today i want to copy database installed by my setup from one place to another by using relative path in vb6.
what i am doing is the following code which is running successfully but using a text file in c and i can save it in any place.

Private Sub Command1_Click()
Dim filesystemobject As Object
Set filesystemobject = CreateObject("scripting.filesystemobject")
filesystemobject.copyfile "C:\test.txt", "C:\test2.txt"

End Sub



但是,用户可以使用安装程序在任何文件夹和任何驱动器上安装我的数据库.我只想使用文件名,以便所有路径都应自动出现并将其保存到任何驱动器或选定驱动器上的目标文件夹中.

请帮助
谢谢您.



But my database can be installed by the user using the setup in any folder and on any drive. I want to use only the file name so that all the path should come automatically and save it to the target folder on any drive or on selected drive.

Please Help
Thank you

推荐答案

使用 ^ ]获取源文件和目标文件的完整文件名.
Use OpenFileDialog[^] to get the full file name of source and destination file.


这篇关于在vb6中使用相对路径复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆