.net - Getting Location Of File?
Mar 2, 2011I would like to know how I could build a dialogbox in VB.net that instead of opening a file can record its name and location?
View 1 RepliesI would like to know how I could build a dialogbox in VB.net that instead of opening a file can record its name and location?
View 1 Replieson my program i have an activation in it and in order to activate the program you need to enter a code that is stored in the settings. so i was looking through my computer and i found the programs config file. and so I opened it and i found all of the codes for the activation. I need to find out how to make the file so the user doesn't have access to it and then how to move it to a more hidden place in the C: drive.
View 3 Repliesi just want to ask how can i save the file location or directory of a file in mysql without deleting its slashes...i tried to save it directly.. for example: the original directory is c:folderimg.jpg and when i checked it on mysql it is save as c:folderimg.jpg
View 5 RepliesI'm looking for a way to specify the location for the User.config file that is used for storing the My.Settings object. It appears that this is not possible. The problem for me is, I don't want to be responsible for creating several different files on the users computer that really have no use and are difficult to find and clean once an update is released. For most users, this is not a serious problem, as many will probably never update the software, and most will probably only go through a couple of updates. On my system, there are config files for every build of the application, and the same to a lesser extent will be true for my beta testers.
I can understand that MS wants to make sure that no two applications will use the same location for storing application data, but a simple [UserData] [CompanyName][ApplicationName] for storing application data will probably suffice for 99.9999 percent of the legitimate applications in the world. Bogging a user's system down with erroneous files, no matter how small, is an unnecessary drain on system resources and a potential source of problems for the user. It's bad enough that most programs leave bits and pieces of themselves all over a user's system after De-installation - this to me seems only to exaggerate this problem.
Is the only way to get around this problem to write a whole new Settings Class? Is there a way to change the location of the UserConfig file to a more friendly (and more predictable) location that I am not finding for myself? It would seem that having at least the OPTION to specify a location for the User.Config file would be OBVIOUS and easy to implement, so why did they leave this out?
I need to get the extension part of a file path for example,
c:me.jpg
i need to return the ".jpg" to a string. Im sure this is easy enough, im guessing i need to get all the text after the last .
ok im tryin to run an embedded .exe in my app but i seem to be having a issue with my code can someone have a look
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
Dim size As Long = My.Resources.Myprogram.Length - 1
[Code]....
my error is ' Read ' is not a member of 'system Array'. i have change the program name to Myprogram i have added myprogram.exe and then the 'exe' is not a member of 'system array'
Program conversion VB6 to VB2008 I have software which uses an ini file (this is necessary as sometimes the ini file needs editing). Normally you place the ini file with the exe.
How do I refer to the ini files location in VB2008 The readini has lines similar to this at the moment where I have set up the test ini file on the root of D:.
LOGOutput = ReadIni("D:MyProgram.ini", "Settings", "LOGOutput")
I'm assuming there is going to be a simple line which says
My.application.location.programname & ".ini") But I can't find it.So question is, How do I read and refer to my ini file which is located with my exe?
EDIT:It's just dawned on me, I am also going to have to get the installer to know about it and install it there??
i am using an unbound datagridview so i can dynamiclly add rows. all that is working fine. but the grid is not is the location i have coded.. i am using the defualt form as a base then coding the unbound stuff in.. should i just create a blank class file and do everything? the only problem i am having is the grid must bees in the correct location according to the pixel point that i have given it. Right now it is placing the grid at point (0,0) no matter what point is entered on the line for location. so what am i missing??????
View 3 RepliesI got a error when I run this code:
Dim btch As String
Dim LeftPart As String
[CODE]...
It says index and location must refert to a location withing string
dim cn as oledbconnection
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:valid.mdb")
[code]......
I have 2 group box components and both are same size,font,location and visible is false. When i click button2, the groupbox1 won't appear(the group box2 is on bottom n group box1 is on top).
Example:
button1
groupbox1.visible=false
groupbox2.visible=true
button2
groupbox1.visible=true
groupbox2.visible=false
Because i want to show the different,so the location have a little different(actually both are same location). I think my code is no problem. The problem i guess is both component cannot locate at same location?
we have a user that my program works fine for.. and another that it just crashes for.. they get this error
"You cannot start application <App_Name> from this location because it is already installed from a different location."
then they run it up again and it comes up.. and then just closes..in reading some stuff online it says its a framework 2.0 sp 1 issue ?these pc's have 3.5, but my program uses all 2.0 stuff..so is this a 2.0 sp level issue ? or should I make my programs start to use framework 3.0 instead ?
I was using this old method of creating a bunch of rectangles when I need to get the location of a certain point within a grid so I could draw images on the grid. The thing is, I don't want to use rectangles, I want to be able to just round the location as if I were using rectangles. I need it to be able to round the point (66,70) to (50,50) so if you can imagine a grid and the mouse position being within that square in the grid, I need to get the location of the upper left corner of that square.
View 5 Repliesi am try ing to copy a file from one location to another useing an openfile dialog but it dosn't seem to work. The code i am using is below
FileCopy(OpenFileDialog1.FileName, "C: emp rial.tar")
I am trying to update my database. A user is going to enter in the location of a file. ex C:file.txt
This is the code I am using Sql = "UPDATE `Users` SET `FolderLocation`='" & FolderLocation & "' WHERE `Username`=" & TextBox2.Text & ";" My problem is that it does not like the . How can I fix that? Is this my code or a database set up error?
When I open appl.exe in C: , app1.exe call in app2.exe and then app2.exe will run and app2.exe will give the file location of app1.exe with extension such as C:app1.exe in run time. Here I wanna know how to reveal the location of calling application (app1.exe) with extension from app2.exe. I mean that app2.exe is called by app1.exe and when app2.exe is running, I wanna reveal the location of app1.exe with extension from app2.exe.
View 1 RepliesI suppose I have two applications such as app1.exe in C: and app2.exe in D: .When I open appl.exe in C: , app1.exe call in app2.exe and then app2.exe will run and app2.exe will give the file location of app1.exe with extension such as C:app1.exe in run time.Here I wanna know how to reveal the location of calling application (app1.exe) with extension from app2.exe.I mean that app2.exe is called by app1.exe and when app2.exe is running, I wanna reveal the location of app1.exewith extension from app2.exe.
View 1 RepliesI am trying to get list of print jobs and I want property name that returns file location of document being print. I have search through all print class and management class but could not find property that returns current document is being print.
View 1 RepliesI am currently developing a Windows Service in VB 2010. The service depends on two binary files and one text data file that contain connection information for the app. At this time I have an installer setup with the service so that when I build the service and then the installer I get a setup.exe and MSI file.
I added the three additional files to the installer project and notice that they get placed in the application folder, that is, in the same folder as the application, when the setup app is run. For the two binary file this is ok and actually required, but
I would like the data file to go into the docs and settings, <user name>, Applications Data, <AppName> folder, NOT the Application folder as it defaults to. The Folder property in the properties dialog box for the data file allows me to select Application Folder, User Desktop or User Program Menu as the location of the file on the target machine, but none that will let me select where I want the file to go.
Is there any way to tell the installer where I want the data file to go? Since the installer itself is a project with code, perhaps I can add code to manually create the data folder for the application and then copy the data file from the application folder
to the data folder, but I am not sure of this.
I have some .txt files in the resources of my vb.net project. I am trying to use the command:
FileOpen(1, "FILE NAME", OpenMode.Input)
How do I use my resource location as the file name?
I have encounterd a problem when trying to re-enstall a program i have writen in vb 2008.I get the following message:"You cannot start application Shell from this location because it is already installed from a different location."This program is to be used on many workstation computers and i need to be able to update any changes by just reinstalling the program, no uninstalling needed first. If the program was installed from a cd first and needs to be updated from a flash disk this error will be a problem, if the update is from a cd as well then there is no problem.Is there a way to change the installation package to ignore where the program installs from and just update itself?
View 2 RepliesI'm currently working on a project that has a simple game . I want to change the location of a label ( middle ) to another location when a key is pressed down. But there is something wrong with the first of the If statement .I've underlined "point " because it has the error.
Private Sub Space_Navigator_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Up Then If middle.Location = [u]Point[/u](156, 655) Then middle.Location = New Point(156, 547)
End Sub
i am having a trouble about adding a file location (e.g. c:/bla/blahblah)to a database i have my code here
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\WindowsApplication2\Database1.mdb"
AxWindowsMediaPlayer1.settings.volume = 100
[code]....
everytime i add a mp3 file to listbox it should get the file location and pass to the database but it seems my database is empty?
I need to holds the common settings for all of the apps ona server (UNC path). Previously I used an ini file on the server and the application was told to look there via a command switch.
I understand that I'm trying to use .net in an old fashioned way by not packaging it for web update & delivery but that's a contraint of the architecture I need to work with.
Is there any way to force my application to use the application.exe.config file from a set location rather than the user data area that .net automatically writes it to? Even if not on a server path, then in the application directory where we can push update it?
I am running a ssis package from .net code.It's a simple package that imports a text file into a sql database.[code]...
View 10 RepliesI need to allow users to download a file to their machine in my vb.net web app. I need them to browse to the download location themselves through some kind of navigation window.
View 1 Repliesi am doing a VB.NET 2.0 Windows Application.I want to create an ini file in the location where we are installing the application. the code that i wrote is [code]
View 4 Repliesi am doing a VB.NET 2.0 Windows Application.I want to create an ini file in the location where we are installing the application. the code that i wrote is
Private Sub Installer1_AfterInstall(ByVal sender As Object, ByVal e As System.Configuration.Install.InstallEventArgs) Handles MyBase.AfterInstall
Dim iniPath As String
Dim Asm As System.Reflection.Assembly =
[code]....
but its not working.
i have created a program , that uses a few text files.i am currently using the file paths of these text files which will obviously error when i move the text files..is there a way to create a text file where the exe is located , this could be anywhere?
View 7 RepliesI am using VS2008 and for the project I am creating, I have a "settings" text file I am using to save user defined settings like color theme, homepage, etcetera. It works fine, however, I am unsure as to how to handle the eventual distributed apps' destination folder/file.
Creating a pre-determined folder/file is easy enough, but what I'd like to do is make it part of the installed folder files, which should be:
I tried creating the file if it wasn't found, however this did not happen (Though I specified the above formatted pathway) perhaps because I was in debug but it should have saved the text file, which it did not and wasn't found anywhere after saving/creating one.
I have the InnoSetup application (Looks great BTW) and see I can include a starting default text file AND make a specific directory for it, but I am unsure as of yet how Inno works exactly, but would prefer testing it through debug before an install anyway. Wish SHOULD be able to be done, am I right?
The odd thing is that although the file was NOT created as specified when creating one, it DID save a setting when I re-ran/debugged the app. (Rather odd, how is this happening I wonder?)
Here is how I am trying to resolve my problem...[code...]
So I am also wondering... if I use the InnoSetup to "set up" the directory and file, and it is according to user-defined destination, how do I reflect that decision in my coding for reading and writting the file?
I could simply use a basic path like C:DATAFILES but this wouldn't be very professional, though fine for development purposes.