Get The USB Or External Harddrive String Path?
Apr 29, 2010This Thread is like [URL] but its already answered so i made a new:
If i want to get the USB or external harddrive string path??If you donīt Believe in it, Then it Doesnīt Exist!
This Thread is like [URL] but its already answered so i made a new:
If i want to get the USB or external harddrive string path??If you donīt Believe in it, Then it Doesnīt Exist!
I am currently working on a program that only I can use to send and retreve files from an external harddrive through my older laptop. But I have only just started and need help with the login form. I want my password and user on labels placed on form 2 and need form 1 to retreive them then I click the login button, however I want form1 to close if the user or password are incorrect. How could I go about placing an if then statment for if correct then it opens a new window if wrong then end program. Heres my login code so far.
Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click
If User.Text = "*********" And Pass.Text = "*******" Then
MessageBox.Show("Welcome")
[Code]...
Start("Program.exe")
This does not work
Nor thisSystem.Diagnostics.Process.Start("Program.exe")
Only this works...but I can't use the Drive path..cannot hardcode it.
System.Diagnostics.Process.Start("C:Program FilesX-ProgramProgram.exe")
So how do I start an outside Exe file from within vb net without hardcoding the path.
Vb net 2008
I guess this one is pretty basic, yet i have not been able to figure out.So here's the deal, my application uses an external exe to generate some txt files that the application needs for a use case. Since hard coding the path of such exe would be hideously wrong in so many aspects i would like to include a little configuration option for the user, so he can specify the path of the external exe for the application to be used.I also would like to have something like that for the path of the Database I'm actually using.
View 2 RepliesIs it possible to get this information from a drag&drop Startup path of a external program that was dragged over my app? The process name of the external program that was dragged over my app? This is what I already got. Private Sub Main_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
[Code]...
I'm writing small VB.Net app which should build reports based on data gathered from some external MDB-files (Access 2007).
It was planned that this app will use parametrized SQL queries to collect data from DBs.
One of the parameters for these queries is path to the external MDB-file.
Here goes sample code:
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:TempTemp.mdb;")
conn.Open()
[Code]....
Looks simple but doesn't works. After launch my app throws following exception - System.Data.OleDb.OleDbException: Disk or network error.
Have spent a whole day to make it work with no success. What have I done wrong?
I'm writing small VB.Net app which should build reports based on data gathered from some external MDB-files (Access 2007). It was planned that this app will use parametrized SQL queries to collect data. One of the parameters for these queries is path to the external MDB-file.
Here goes sample code:
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:TempTemp.mdb;")
conn.Open()
[Code]....
My question is as follows: The user has clicked File>Open in Notepad and also clicked on a file/folder. My Application in VB.NET needs to know the path and filename of the selected file/folder before the user selects the OK button of the Open Dialog box. How can I do this with VB.NET (VS2010).
View 5 RepliesI know that here there is a similar question but I would like, if possible, to be able to define a relative path for 'Start External Program' or any workaround that do not constrain me to add a complete new empty project to my solution. I am using VB.NET in Visual Studio 2010 environment developing WinForms apps.
View 4 RepliesI want to get letters to each harddrive I have recognized in WMI . I give an example:I have:
1x HDD (400 GB) Samsung (fixed) - 4 partitions (one of them is for Linux, the biggest problem!)
1x HDD (250 GB) Seagate (external) - 1 partition
And in Windows I can see 4 harddrives. So the thing: How can I get exact letters belonging to Samsung, and letter(s) belonging to Seagate? Make sure, that user can have more drives and more partition (maybe Linux too) ... I can divide my Seagate too, like 20 GB and 230 GB ... you know. I've checked much things in WMI like Win32_DiskPartition, but it does not help me so much ...
i have several files that are resources in my program and i would like to be able to copy them to the users hard drive for later use for the user. I have tried everything that i can think of, i just can seem to find one that works, the code below is the closest i have gotten, but i get an error on the first part about My.resources.iPad just to let you know, ipad is an exe file.
FileCopy(
My.Resources.iPad, InstallDir.Text)
The error i get says: Error 1 Value of type '1-dimensional array of Byte' cannot be converted to 'String'.
I have created my windows from app. and published it. but i was wondering if there is any way to publish it so that the user doesnt have to install to there hard drive so when they click the .exe file it just runs the program Does anyone know of any good walkthrough's or could you let me know how to do this?
View 7 RepliesI installed my app on a computer. I can launch it from the shortcut and it works fine but I can't find the .exe file anywhere on the harddrive. The shortcut created by the install just shows the location of the shortcut. how I can find the executable for my app? I'm using VB8 Express
View 6 RepliesI'm trying to open a .txt file from my harddrive by just clicking a button.
I've tried the following:
If System.IO.File.Exists("C:Test.txt") = True Then
File.OpenRead("C:Test.txt")
End If
[Code]....
Part of my project is to retrieve a string variable from an external source (google docs) and parse it. This string represents width and height. I have no problem retrieving, I just need to parse it in to two strings. The string has 4 variations.
Here are examples:
3"x4"
3"hx4"w
3hx4w
3x4
The width is always the first number and the height is always the second. Sometimes, the width and height have decimal points. Any way to parse this into two strings of the numeric values only?
I have a Access program and I'm using VBA code in the background to run Winunzip using shell command. Well, the path of the .zip file has spaces in it and it's not recongizing the path as a valid path. Is there a another way to tackle this problem besides the shell?I can't us pkzip either. Has you can see I had to use progra~1 instead of Program Files.[code]
View 2 RepliesI don't think you understood the title, but this is what I mean: If a path string is "C:UsersUserNameImages2010NovemberMyDogMondayDog1.png" for example... How could you like cut it to 30 characters: "C:UsersUserName...Dog1.png".
View 6 RepliesI get an "augmentexception was unhandled" error whenever I run this script. The string assigned to "location" is fine, in fact when I paste it to the clip board and replace the "location" string in the ReadAllText() it works fine. Any suggestions? I assume this is a super easy fix but I've been at it for quit a while with no luck.
Code:
Public Sub OpenQuestions(ByVal questionreturn As String)
Dim Qraw, location As String
[code].....
I can't seem to get this to work. I am just a novice plugger and do some of these forms for my work occasionally. I am assigning a textbox result to a variable. I then want to use that variable in a path string i.e. ("c:some stuffvarname") but the variable looses focus once placed inside the quotes.
View 4 RepliesI am concatenating a variable onto a path(string), i'm using a message box to display this for testing purposes, I can see that the variable is starting on a new line, which in turn when i try to open the file it doesn't recognize that the file exist...
Dim Path As String = "C:UsersstefanDesktopUni WorkYear 4ProjectsProject SelectionProjectProjectinDebug"
Shapetext = clickedShapes.Item(nextShape).Text.ToString.Substring(0, clickedShapes.Item(nextShape).Text.IndexOf(" "))
MsgBox(Path + Shapetext + ".txt")
I want to know the path of windows directory then create a folder within it automatically example : test1
so the vb.net application shoult detect the path to windows then create inside of windows folder a folder named test1[code]....
Possible Duplicate: SQL Express Connection string - Relative to application location
I have a desktop application written in vb.net. The app uses an SQL Server express 2008 database (.mdf file).Currently i have the connection string as absolute path like this:
Dim ObjConnection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=C:UsersPantheoDocumentsVisual Studio 2010ProjectsFood Manager 2012(new)Food Manager 2012Food_CustomerDB.mdf;Integrated Security=True;User Instance=True")
[Code]...
Possible Duplicate: SQL Express Connection string - Relative to application location I have a desktop application written in vb.net. The app uses an SQL Server express 2008 database (.mdf file).Currently i have the connection string as absolute path like this:
Dim ObjConnection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=C:UsersPantheoDocumentsVisual Studio 2010ProjectsFood Manager 2012(new)Food Manager 2
[code].....
I have a treeview with a few files. The node.tag contains the path. Now, when I change the e.label I also need to change the tag of the node.
Let's say the current tag of node "test.txt" is "C:Folder1 est.txt " and I change it to "blabla.txt", the tag needs to be changed to "C:Folder1labla.txt"
How do I extract the file path from the following connection string?[code]...
View 1 RepliesI have an editor that saves text files and html files. I want to open my html file in Internet Explorer.
The code for opening the IE and the file is below
Shell("C:Program FilesInternet Exploreriexplore.exe C:abc.html")
I have an xml string which I am attempting to create an xmlDocument from but I keep getting the exception "Illegal characters in path".
This is the string :
HTML
<?xml version="1.0" encoding="UTF-8"?>
<scanResponse>
<Authentication>Authentication1</Authentication>
</scanResponse>
What illegal characters and where?
I wanted to know if it is possible to Zip a folder without any external dll nor any external references - just with native features.I've been able to Zip files with System.IO.Packaging, but it does not include folders and I cannot tell it to Zip the parent folder.I know there are external dll and so, but I'd like to know if it's possible to make it from a native way.
View 1 Repliesi was trying IndexOf before this and it could get it to work, now im trying to use the Contains()
path.Contails(word(1))
pathis the file path eg B:\Movies
word(1) is a split string eg Transformers 2
i want to find the string transformers 2 in the path and enter my if statement .heres my code[code]......
Dim dbconn As OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DS As New DataSet
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:COLORsitedataCUFORHDR.dbf;Extended Properties=dBASE IV;")
[Code]...
I prefer SQL server but im afraid in this app I have no choice. I think the .DBF file is v III dBase according to a thrid party .dbf viewer. The code explodes on the DBCommand.Fill(DS) line, telling me I have provided and invalid file path. The path is good to go.
Should I be using a driver with a different provider? When I remove the Extended Properties parameter I get an error unrecognizable database format - hinting in this case the path is correct.