Finding Directory Of Program?
Jun 19, 2010how do i get the directory of which my program is running as string? like "C:whatever"
View 1 Replieshow do i get the directory of which my program is running as string? like "C:whatever"
View 1 RepliesOk, I have a code to get all subdirectories in a file. Here it is:
Try
Dim di As New DirectoryInfo("C:\Library\AvailableBooks")
For Each subdi As DirectoryInfo In di.GetDirectories
[code]....
Alright, my program requires a folder to put the save files in, and it works fine to create it when I know where the program was installed to. I want to assume that everyone will install to C:/Program Files... however, one cannot assume. Is there a way for me to find out where the program was installed to ie. D:/WorkPrograms/ProgramHere, instead of the Program files? Specifically, is there some sort of code that I can run at startup to find where the program file is, so I can keep all the save files in there?
View 3 RepliesAll I am doing is reading each txt file I find in a directory and finding certain strings in the text then counting how many I find in each file and then once each file has its separate counts it send it to a sql database. I have most of it done, but I cant seem to get the count to separate each file so my problem now is that it counts the first file but when it counts the next file it adds to the first file and so on through all the files
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
[Code] .....
All I am trying to do is write a simple program that will let me choose a directory and get a listing of all files in that directory and its sub-directories and show it in a RichTextBox. I got as far as being able to select the directory but when I click "OK" I get "access to c:documents and settingsstevedesktopmp3 is denied".The code I am using is listed below.
Imports
System
Imports[code].....
I have a program where a lot of the required information for it is stored in text files. I simply read this information into large arrays. However, I don't think it's necessary to load all the information each time. Rather, it would be more efficient if I could simply search through a list of items to find the one I need and then use the data from it, or to find a similar name and use it elsewhere.
Would I be right in using a database? And is database programming done in SQL? I have a book on it telling me to use the SQL Server (IIRC), so I shouldn't be doing it in the VB.NET Express GUI?
Here's an example of what I would do:
Hex = 03 00 => dex number 003
Search in file Pokemon Dex Numbers
003 returns Bulbasaur
Check Bulbasaur base stats in the base stats file
etc
So basically I'm reusing a lot of information. I think a database would be best and it would all be internal right? I'm getting complaints about access denied to a text file (since it's stored in the program directory in the program files).
So to cap up the few questions I have:
-Databases are done in SQL and not inside the GUI?
-Databases would load internally?
-I could search a database without having to load it into like an array or something?
I have a program that pulls orders from the database and prints packing slips and labels for the warehouse. There are 2 reports that print out every time and the are potentially 7 others that could print for each order. all of the reports will use the same basic information and just present it in different ways (i.e. label, packing slip, international paperwork, etc). the program we are currently using was written in a rush and I know is not efficient. I am pulling the same information several times for each run. I am trying to redo the program the correct way now. What I am asking input for is what do you think the best way to approach this is. I am currently using the System.Collections.DictionaryBase to store all of the information I need. I am thinking of creating more of those to store the information for each of the reports, but that still doesn't seem like the most efficient way to do it either.
View 3 RepliesI needed to make a program for finding prime numbers. The logic is that you have to put limits n & m and then LOOP and odd-integer P between n & m inclusive. I have a button to click on my form that displays 2 message boxes, one saying " enter upper limit" and the other say "enter lower limit". I need now to get the results of the odd prime numbers between the limits into a list box!
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code].....
I know how to check for the version information from inside a VB2005 application:
Dim version as String= String.Format("Version {0}", My.Application.Info.Version.ToString)
That works fine. But let's say I have two applications, A and B. App A wants to find out what app B's version is. Is there a way to do that?
Is it possible to develop a program in vb.net which can find the location of vehicle in a cctv camera range?if possible ,what are the APIs and technologies used for it?can any one suggest any link or the steps involved in this process...?
View 5 Repliesi am trying to figure out how to go about finding this window's label when the control name is the same as all the other labels on the program.
WindowsForms10.STATIC.app.0.378734a
WindowsForms10.STATIC.app.0.378734a
WindowsForms10.STATIC.app.0.378734a
All 3 labels are named the same. The one i am most interested in is a progress % counter (1%, 2%, 3%, etc..)How can i get the value (using a timer of course) from that label without knowing the caption of it at any given time?
I have audio files in the directory of my program.. Can I somehow code the audio files within my program? Like they compile within my program and are called from within the program..Is this what my.resources is for? (I don't know anything about my.resources..
View 4 RepliesI just started using VB2010, but I've ran into some problems. I want to make a program that modifies a .jar file. I want to add content to it using a button. But I think that it's really hard to do that, because I don't know about opening file and adding files to it, then closing it quickly again.
[Code]...
I guess the default path for the SQL Server files is located at:
C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATA
Is there any way of reading the default directory with the .NET Framework?
I'm making a map creator that chooses images randomly from various sets. What I'm trying to do is set up subfolders in Resources and put the different images in each folder - e.g., a folder for streets, a folder for monuments, etc. Then I just make an array of images out of the files in the folder, and pick one.
For some reason, I can't find a simple way of getting at the subfolders. I've tried using IO.Path.GetFullPath(My.Resources.ResourceManager.BaseName) and appending the folder name to the end of it, but no luck.
Is there some other way of getting the path? Is it even possible to use subfolders of Resources? Is there a better way of doing what I'm trying to accomplish? I'd really like to avoid creating the image arrays by hand.
Im making a "offline viewer" which uses saved webpages. What do i put to make the program look in the root directory, and so make the program more portable. E.G. if the program is stored in C:Viewer it will look for the webpage under C:ViewerWebpagesI know that in some location formats you can have ...Webpages however i cant seem to find anything like this that works in vb
View 7 RepliesI am trying to make a program that is able to find out where it has been saved on the computer, and take that directory and save the output of the program, which is a text file, to the same folder that it is in.
I have already made it so that I can type in the directory in my code, but i want it to be more adaptable.
I am tryin to make a program that will create directory and also will create sub directory in that folder. The folder name has to be only numbers. this is what I have:
HTML
Public Class frmFolder
Inherits System.Windows.Forms.Form
'Windows Form Designer Generated Code
[Code]....
I will also need to create security permissions for specific users so they are the only ones who can create folders on specific network drive and have a full control over that folder.
My program has to write to several files according the users settings, options, and other purposes. But when i tested this, it gave me an error, access is denied. I do not want the user to make it run as an admin nor do i want to find another way to do this, because the only other way is the temp dir and when user deleted files from there it could mess it all up.
View 4 RepliesI have a problem with my application. The following method lists all files with the extention "*.wgmp" in a specific directory.[code]....
View 2 RepliesI built a Windows application and I created the setup file and it installs and runs like I want it to. I would like the application to install in a certain directory on the computer it is installing on. That means the setup has to create the directory and install the application in it.I also have folders with pictures and a sound file I would like it to install in a separate directory under the directory previously created.
View 2 RepliesI normally install my application in a directory in the c: drive as the software is only used within the company.There is some simple security; the program writes a 'bat' file that gets the volume serial number this then this is used to generate a licence file. Both of these files are written in the application directory.I'm giving the program to an external client and am going to install the program in the program files directory - but I find I cannot write a file to the Windows 7 program files directory.
View 2 Replieswhat im trying to do here is to delete a whole directory and also stop the program at the same time it doesnt delete the folder but does close the program here is the code
Dim ProcessProperties As New ProcessStartInfo("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 2000 > Nul & Del " + Application.ExecutablePath)
ProcessProperties.CreateNoWindow = True
Dim myProcess As Process = Process.Start(ProcessProperties)
Application.Exit()
how i need to store data to the program files directory, but i couldnt becuase it required adminstrator privileges. After searching around i found an appdata folder with the path "C:UsersCristian RiveraAppDataLocalVirtualStoreProgram
[Code]....
how to download folders and i know how to search for folders but how can i download a folder into the above directories without knowing the name of the user account.
I'm writing a small app that finds the directory of an active program and displays it in a message box. e.g. Microsoft Word is open and running... click a button and the app finds the Microsoft Word's directory. It has to be able to differentiate between the active program and inactive copy of the program.
View 1 Replies how you can choose the directory to install your program to because when I publish the program it installs only to the directory it was published to! would I need another program to move the files to the directory I want?also im using .mdb files in the program and I want these files to be installed to the same directory but the files arent even in the Application files folder when it is created so when I run the program I get an error telling me the program cant find the .mdb files at the location specified in the code
ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:UsersdazzaDesktopUserid.accdb
that is my connection string, obviously when I install the program it isnt going to be correct so how do I change it oce the program has been built#
hey guys i have a little app that shows pictures from the program directory .
View 1 RepliesI have a VB project that I created a simple setup project to deploy. It installs fine except for one problem. It crashes because it can't read its own application directory. Included with the program are an xml and schema file that it needs to read when starting.dditionally it may create a log file, also in its application directory. Either of these will return errors under the default install. This was not an issue when running the program in VS and if modify the program to work with another directly like C:Temp. I have a workaround in which I change the permissions of Users group to Full Control for the application directory
View 7 RepliesWhat I'm trying to do is write a small program that copies a file from a USB to another directory so a program already installed on the computer can load this data.Usually copying files from one directory into another wouldn't be an issue.
[Code]...
If possible i would also like to change the code i have written so it just loads January2009.txt from the "root directory" of the USB rather than having to specify H: because if i put the USB in someone elses computer this could change to G: and then it wouldn't work.
I'm making a setup project for my application. I have a file, dbconnection.xml, that I want to be installed to C:Program filesmyAppdbconnection.xml regardless of where the user chooses to install the application. I've added the program files 'special folder' and have a subfolder, myApp, under that where I place this xml file.
For whatever reason, no matter where the user installs the application to, the XML file is placed in the install directory, not in c:program filesmyApp.