How do I use the folder path that a user selects and use that path when they download files? - vb.net

I'm in the process of creating a launcher for a game with Visual Basic and I have pretty much everything done except many people may have files in different drives. So, I want them to select a file path then when they have selected that path I want the download button to download the files that the need downloaded to the selected directory. I was thinking that the beginning of the code would be something like this:
Form2.TextBox1.Text
and then something else after that in the buttons code.
I hope I'm being specific enough.
P.S. The reason why this is an issue is because if I use System.Diagnostic.Process.Start("C:\Program Files (x86)\[remaining folderpath here]") to launch the .exe then the program will only look for the files in that directory even though some people may have the files in their D: drives, etc. And, I have a FolderDialog setup and working.

Related

change of location of the database dynamically in app running

Try to make my app read the ms-access database from shortcut of my database it failed to read, so try to change the location of database dynamically ( there is an option in the app to move the database to drop-box folder and create a shortcut to that database in app folder )
try to make an shortcut to the moved ms-database
the app to read the database or to change the location of database dynamically
First of all, you should create a folder with a clear name in your VB.Net application path, namely inside the project Debug folder, let's name that folder as "MyProjFiles", so it will be in this path: ProjectFolderName\bin\Debug\MyProjFiles
Put your whole projects files inside our lovely folder MyProjFiles, including all types of your attachments: database, images, sounds, files, etc.
Call your database or whatever of those attachments files in addition to our \MyProjFiles\ using this method: My.Computer.FileSystem.CurrentDirectory & "\MyProjFiles\YourFilesPathHere.EXT".
Now, the whole path will be such as this string: "C:\CurrentUserNam\RootFolder\ProjectFolderName\bin\Debug\MyProjFiles\YourFilesPathHere.EXT"
For great practical example of this, supposuply let's open our MSAccessDB.accdb which is already copied into our project folder \MyProjFiles\ by this code directly:
System.Diagnostics.Process.Start(My.Computer.FileSystem.CurrentDirectory() & "\MyProjFiles\MSAccessDB.accdb")
The result will be simply opening our database which called "MSAccessDB.accdb"
Or open some pdf files such as this line:
System.Diagnostics.Process.Start(My.Computer.FileSystem.CurrentDirector() & "\MyProjFiles\MyPdfFile.pdf")
and so on.
I hope this can help you all brothers.
Best ^_^ Regards.
You should read this link.
It explains how to read the information you need to give the access Datareader something to do.
.NET read binary contents of .lnk file
Maybe this is enough, so you don't need to copy anything.

I want to copy the file in sandbox without NSOpenPanel

I want to copy some files to specified folder by NSOpemPanel.
The source file is reading from XML and show to list in NSTable.
I can copy file by copyItemAtPath.
But now my app will turn to sandbox, then I can’t copy the file by copyItemAtURL.
How do I copy the file in sandbox mode?
I was looked over a lot of post. And I think the Security-scoped Bookmark may be a solution for this.
But I can’t create "Security-scoped Bookmark" from XML inside the path (the path was convert to NSURL ready).
I was setting to sandbox.entitlements but it's not clear this problem.
Is there any way for this?
Develop in macOS10.12 and Xcode8.3.3
Thanks
How do I copy the file in sandbox mode?
It is unclear what your current code is doing, but the rules under the sandbox are simple: To read or write a file located outside of an application's own container (which is hidden away under the Library folder) your application must either:
Use NSOpenPanel to obtain a URL from the user for the file path; or
Use NSOpenPanel to obtain a URL from the user for one of the ancestor folders of the file.
The second option gives access to a whole folder, including any sub-folders; i.e. the whole file/folder subtree rooted in the folder.
As you want to copy "some files" it sounds like asking the user for permission for the folder is appropriate. You can customise the NSOpenPanel to be a "request permission" dialog. If you are requesting a specific folder you can also have the dialog open in it's containing folder and only have the specific folder enabled for selection by the user.
Once you have the URL for the folder from NSOpenPanel you can create a security scoped bookmark for it and save that in your app's preferences or other configuration file (stored within the app's container). Doing this enables your app to regain access to the folder on subsequent executions without asking the user again.
If after investigating this issue and writing some code you hit an issue ask a new question, showing your code, and explaining the problem. Someone will undoubtedly help you with the next step.
HTH

VB.Net Run.exe with Form button

I'm pretty new to VB so I need a bit of help with some coding.
I made a program that should download a certain file to what ever directory the user wants, but now i want my program to run that certain file but i don't know how to do it since the user used his/her own directory.
Like i want the program to run that certain file no matter where its saved, how do i do that?
I do know this code:
System.Diagnostics.Process.Start("C:\")
but this doesnt really work since i have to put in a directory before i use the program.
You can get the path of the SFD by using filename.
Dim Path as String
Path = SaveFileDialog.FileName
Then run the file.
System.Diagnostics.Process.Start(Path)
Found another way of doing it,
I just used:
file.open(textbox1.text)
And made it take the text forom the the other textbox the user browsed the file to

Vb. how to make the file save files in a folder iam using the files in form

Lets Says I Want To Make A Think Like Saver Forum But Another Think Like
Folder Browser Diadlog Download / Save Files I Use In The Forum Not Load Then Save
Files I Use It And In The Folder They Select (Another Pc) I Want It To Save The Files/Download In The Folder And They Will Be Think Named Wolfteam.exe Thats Mean Start The Game And Use The Files In The Game Folder
Thanks For Help.

I need help about deploying a windows application

I have visited http://msdn.microsoft.com/en-us/libr...(v=VS.71).aspx. I have learned many things. But it didnt make clear about those files what I have used there in my program. I know I can add additional files. Does it mean that I have to add those files there in additional file dialog box what I have used there in my program like images. Even I have created pic forlder there in debug folder to save pic how should I add it there in my setup file? I am totally confused. I have searched there in gogole but it doesnt say anything about source files like images & anyother thinkgs like text to speack .dll grid .dll. I thought it will combine them together automatically. Please tell me step by step how should I do it. Once I thought I have to add all files present there in debug folder. I am totally confused please help me.
Have you added a setup project to your solution? You start there. Then you can add images or whatever else you need to the setup project.
Anything referenced in your project (like grid .dll files or any other .dlls you're using) should get included automatically.