• Welcome to ForumKorner!
    Join today and become a part of the community.

Help in VB Coding

matwan96

New Member
Reputation
0
hello guys, im new here at FK. I going to make some tool that can

-browse for special extansion like .wtd or whatever in a ZIP or RAR File

-read text in a txt file. For example, 
NAME: TESTER
then import the text to another txt file
NAME: TESTER (txt file 1) to NAME: TESTER (txt file 2)

-browse an extansion file then import to listname

-installation
example: .wtd file install into .wtf file

if there's any person that can help, i would be appreciate.
 thanks!
 

Jake

Member
Reputation
0
VB is such a pointless language to me, but here's how you can read a text file directly. You will need an open file dialog to open files and you will also need to add the System.IO namespace to the top. (ex. using System.IO) This is C#, so convert it OR switch to C#.

Code:
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
          listBox1.Items.Clear(); // This will clear any items that may be inside of your list box
          listBox1.Items.AddRange(File.ReadAllLines(openFileDialog1.FileName)) // This will read the file you open and display the items in the list box
          listBox1.SelectedIndex = 0; // This will highlight the first item in the list box
}
else
{
          // Add anything here if you want
}
 
Top