473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Obtain path to save a file

16
Hi,
I am working on VB 6.0 and I want to create a browse button to which when I will click then I will get the storage path to where I want to save my generate file.
So please help me.

Thanks & Regards
monu
Jul 16 '07 #1
4 2168
hariharanmca
1,977 1GB
Hi,
I am working on VB 6.0 and I want to create a browse button to which when I will click then I will get the storage path to where I want to save my generate file.
So please help me.

Thanks & Regards
monu

i think you mean file dialog control...

is it?
Jul 16 '07 #2
hariharanmca
1,977 1GB
Hi,
I am working on VB 6.0 and I want to create a browse button to which when I will click then I will get the storage path to where I want to save my generate file.
So please help me.

Thanks & Regards
monu
monu121 don't double post your thread. Okay...
Jul 16 '07 #3
Killer42
8,435 Expert 8TB
I am working on VB 6.0 and I want to create a browse button to which when I will click then I will get the storage path to where I want to save my generate file.
Sounds as though you're looking for the Microsoft Common Dialog Control. Look it up in the doco.
Jul 17 '07 #4
Something like this should work for you. You'll need to figure how you'll implement it into your code and change the file filter options to suit your needs! You'll also need to have a textbox on your form named txtsetfile and a button named btnBrowse or change the code to suit your needs! No one answers me here so I hope this helps you out!

Expand|Select|Wrap|Line Numbers
  1.  
  2. Public selectFile As String
  3. Public setfilePath As String
  4.  
  5. Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
  6.         Setfile()
  7.         txtsetfile.Text = setfilePath & "\" & selectFile
  8.     End Sub
  9.  
  10. Public Sub Setfile()
  11.         Dim selectFileLocate As New OpenFileDialog
  12.         selectFileLocate .Filter = "Executable (*.exe)|*.exe"
  13.         selectFileLocate .Title = "Select file"
  14.         selectFileLocate .InitialDirectory = "C:\"   
  15.         selectFileLocate .CheckFileExists = True
  16.         selectFileLocate .CheckPathExists = True
  17.         Select Case selectFileLocate .ShowDialog()
  18.             Case DialogResult.OK
  19.                 selectFile= IO.Path.GetFileName(selectFileLocate.FileName)
  20.                 selectFilePath = IO.Path.GetDirectoryName(selectFileLocate.FileName)               
  21.             Case DialogResult.Cancel                
  22.         End Select
  23.         selectFileLocate.Dispose()
  24.     End Sub
  25.  
  26.  
Aug 4 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Sam | last post by:
Hi, I can use System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() to obtain the path for ILASM.exe, but how can I obtain the path to ILDASM.exe? Examples of the path I'm...
5
by: CDMAPoster | last post by:
I have changed how I get the shell path for Acrobat Reader based on code posted by John deKrafft. Does anyone see any problems with this code running on various Windows OS's? '--Begin Module...
7
by: dmitrey | last post by:
Hi all, I guess this question was asked many times before, but I don't know keywords for web search. Thank you in advance, D.
7
by: Tony K | last post by:
How can I customize, at runtime, the path for the OLEDB connection uses. I used the Add Data Source Wizard and found the path set by the wizard is ReadOnly.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.