copy file in vb.net
-
hi for all I want select a file in my disk by openfiledialog tool in vb.net then copy selected file in a special path with any format please guide me thanks.
faravani wrote:
hi for all
Goodmorning :)
faravani wrote:
I want select a file in my disk by openfiledialog tool in vb.net
That's done using the
[OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx "New Window")]
class. Call it'sShowDialog
method to show it, and retrieve the path of the file that the user selected using it's[FileName](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx "New Window")]
property.faravani wrote:
then copy selected file
That's done using the
[Copy](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx)[[^](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx "New Window")]
method of theFile
class. Do remember to check the exceptions that it might throw.faravani wrote:
in a special path
You can use each directory. If you need to fetch the directory of a folder, consider using the
[GetFolderPath](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx "New Window")]
method :)faravani wrote:
with any format
It would copy the data there, provided that it's accessible (you have the appropriate rights, not locked by another process etc.) Hope this helps :)
Bastard Programmer from Hell :suss:
-
faravani wrote:
hi for all
Goodmorning :)
faravani wrote:
I want select a file in my disk by openfiledialog tool in vb.net
That's done using the
[OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx "New Window")]
class. Call it'sShowDialog
method to show it, and retrieve the path of the file that the user selected using it's[FileName](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx "New Window")]
property.faravani wrote:
then copy selected file
That's done using the
[Copy](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx)[[^](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx "New Window")]
method of theFile
class. Do remember to check the exceptions that it might throw.faravani wrote:
in a special path
You can use each directory. If you need to fetch the directory of a folder, consider using the
[GetFolderPath](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx "New Window")]
method :)faravani wrote:
with any format
It would copy the data there, provided that it's accessible (you have the appropriate rights, not locked by another process etc.) Hope this helps :)
Bastard Programmer from Hell :suss:
Cannot get any clearer than that .:)
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
-
faravani wrote:
hi for all
Goodmorning :)
faravani wrote:
I want select a file in my disk by openfiledialog tool in vb.net
That's done using the
[OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx "New Window")]
class. Call it'sShowDialog
method to show it, and retrieve the path of the file that the user selected using it's[FileName](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx "New Window")]
property.faravani wrote:
then copy selected file
That's done using the
[Copy](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx)[[^](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx "New Window")]
method of theFile
class. Do remember to check the exceptions that it might throw.faravani wrote:
in a special path
You can use each directory. If you need to fetch the directory of a folder, consider using the
[GetFolderPath](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx "New Window")]
method :)faravani wrote:
with any format
It would copy the data there, provided that it's accessible (you have the appropriate rights, not locked by another process etc.) Hope this helps :)
Bastard Programmer from Hell :suss:
:thumbsup: Good answer.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
-
:thumbsup: Good answer.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)