Tuesday, May 31, 2011

Storing properties in VB.NET?

I have an application that I'm developing in VB.NET. One function it has is to process input files from one directory and produce output files to another directory. I want the locations of these directories to be put into a flat file and read when the application begins. This will give administrators the ability to change the directory path without having to recompile the application. I have done this in Java using a .properties file. How is it done in VB.NET?Storing properties in VB.NET?
Here is a code sample from Microsoft

http://msdn.microsoft.com/en-us/library/



It basically scan's folders and files....all you'll need to do as add the part where you said to produce output files into a flat file....should be fairly straightforward.Storing properties in VB.NET?
Try this code. Use getDirs to open the file and get the input and output directories. The structure ';dirs'; is just a structure to store the input and output directories.



'Start code'



Const propFile = ';C:\PropFile.txt'; 'This is where the property file is stored



Structure dirs

Dim inputDir As String

Dim outputDir As String

End Structure



Function getDirs() As dirs

Dim content As String = My.Computer.FileSystem.ReadAllText(propF?br>


Dim data() As String



data = Split(content, ';,';)



Dim retVal As dirs



retVal.inputDir = data(0)

retVal.outputDir = data(1)



Return retVal

End Function





'End code'





In PropFile.txt, place the input and output directories on the same line, seperated by a comma. (input first, then output) like this:



C:\Input.txt,C:\Output.txt



So the admins only have to edit this file. Just remember to keep the comma.



To retrieve this info in the program, call the getDirs function, with the path to the properties file as its argument, and store the result in a variable of type ';dirs';. Then, use the inputDir and outputDir property of the variable to get the respective values. Like this:



Dim MyDirectories As dirs

MyDirectories = getDirs(';C:\PropFile.txt';)



Dim InputDirectory as String = MyDirectories.inputDir 'Holds inputDir

Dim OutputDirectory as string = MyDirectories.outputDir 'Holds outputDir





Hope this helps!

I need help with Oracle 10g for Windows. Anyone know how to open a terminal window?

Also, how do I change the working directory?I need help with Oracle 10g for Windows. Anyone know how to open a terminal window?
A ';terminal window'; is a command prompt. On Windows, you can access this by going Start -%26gt; Run and entering ';cmd';. On UNIX systems, you have to start a terminal through whatever GUI they have (on Red Hat Linux, for example, you can get a terminal through Applications -%26gt; System Tools -%26gt; Terminal).



You change the working directory of a given terminal by issuing the cd - ';change directory'; - command. For example, if you were on the C:\ drive and you wanted to go to C:\Oracle , you would type:

cd Oracle



If you wanted to go up a directory, you would type:

cd ..

because .. means ';the directory above this';



You can also use a full path, so if you wanted to go from C:\Oracle to C:\WINDOWS\system32, you could use either of these:

cd ..\WINDOWS\system32

cd C:\WINDOWS\system32



On Windows, you can get more help on the cd (and other commands) with ';help cd'; and ';help';. On UNIX, you would use ';man cd'; and ';man sh';, because 'man' stands for 'manual'.

Loading Mozilla on drive other than 'c' drive.?

I have made 4 partitions on my sata HD. 1st('c' drive) for windows, 2nd for most other soft wares and remaining two for exe files and data. I downloaded mozilla on my desktop. The set up wizard of Mozilla does not give me the option to install it on any other place than 'c' drive. How do I change the directory to say 'E' or 'F' drive?Loading Mozilla on drive other than 'c' drive.?
Select custom install instead of typical or what ever the default is and it will give you the option.Loading Mozilla on drive other than 'c' drive.?
If there is not a custom install, you can't.
keep it in c drive cas it will be best suiteed there as c drive manages all the softwares better any others.

When I try to make a yahoo 360 page it says that my email address is already being used, what do I do?

I have recently tried to create a yahoo 360 page but every time that I do it tells me that my email address is already being used and that I need to go to the member directory and change my email address? What do I do? How do I go about fixing this problem?When I try to make a yahoo 360 page it says that my email address is already being used, what do I do?
I had the same problem and I asked a question about it:-



http://uk.answers.yahoo.com/question/ind



Some people told me to set up another email address but I haven't tried that so I don't know if it would work. The Best Answer says 360 is closing down and Yahoo are not fixing the glitches so I don't think it's worth bothering with it.
  • squirrel stalking
  • tighten loose skin
  • I am looking at a webpage and it asks me to change something in the root directory?

    In order to view the page. Is it safe to do it and how do I do it? Thanks.I am looking at a webpage and it asks me to change something in the root directory?
    Sounds like you had your homepage hijacked! DON'T DO WHAT IT SAYS TO!! Run virus scan %26amp; clean any virus threats. May also be helpful to do a system restore to last week.I am looking at a webpage and it asks me to change something in the root directory?
    Don't do it!!

    I've never run across this, would never do it because a webpage asks you to, why would you?
    because i like hedgehogs i will tell you a golden rule, never change anything on your system because a site or web page wants you to, if a site wants you to access it then it will be set up ready for you to access it, you should not have to make changes to your system to accomodate the site. If it wants you to make changes then there must be some other motive for this. Why not post the name of this site on here for everyone to see, there will then be more chance to expose them for what i suspect them to be. I am so pleased that you had the foresight to post the question here before making changes. take care and good luck, by the way, we now have 2 families of hedgehogs in the garden, do you know how noisy they are when they fight LOL.

    How to get rid of duplicant content in...?

    How do you get rid duplicant content on a wordpress blog. For example i want to stop google %26amp; other search engines indexing the /tag/ directory since it douples up posts in google. Also i changed the permalinks structure from /2010/.../ to a imrpoved SEO structure and google still shows the /2010/ links since they redirect to the new structure. So what do i do? Do i write in the robot.txt file to disallow those directories .. /2010/ %26amp; /tags/ or would that make it worse for SEO? and should i have the categories indexed or not? please answer my 2 questions :] would be happy if you did.How to get rid of duplicant content in...?
    did u try wordpress duplicate remover plugin?? just search for it

    Can you perform more than one command in DOS?

    Can you perform more than one command at once in MS DOS? And if so, how do you do it?



    Im trying to make two directories, then change my current directory to one of the newly created ones at the same time, is that possible?



    Im trying:



    E:\md one two; cd oneCan you perform more than one command in DOS?
    You're talking about executing multiple commands on one line like in Unix? Try ';%26amp;%26amp;'; instead of ';;';Can you perform more than one command in DOS?
    Yes, simple command structures are '; Format C:\ U'; this means your formatting C drive with no conditons or replace U with S to copy system files when formatting. etc... If you use a start disk you'll see that a ram drive is created to hold the tools needed etc... you cant make the directory (MD) if E dosn't exist also E wont be a dos system partion anyway you need to make it so with Fdisk so with what I'd say is limited knowledge then stay clear. Suggest you download or read up on dos 6 or above 6.22 for instance, perhaps find an old pc to muck about with load the dos and use help funtion and text contained to learn more about dos.
    Yes, type ';help'; [Without quotation marks] and you will see a complete list of commands
    Can't be done
    put the commands in one text file and save the file with the extension as bat



    and double click it
    You can create an MSDOS batch (.bat) file with the commands you want to execute and then run that batch file from the command prompt or by double clicking in windows explorer.

    There's a good introduction here with examples

    http://www.computerhope.com/batch.htm