foto51
Feb 14 2007, 03:50 AM
| | Hello, I have a project that I am doing. I have a list box that you can enter data in, and I need it to have the ability to save that list into a text file (Names.txt). The txt file should have each entry on it's own line. Any help would be appreciated. |
Reply
Galahad
Feb 17 2007, 05:59 PM
I'm not sure about Vb.Net, I haven't touched it in couple of years, but I can give you code, how it would look in VB6, and you can go from there: CODE Dim i As Long
Open "Names.txt" For Output As #1 For i = 0 To List1.ListCount - 1 Print #1, List1.List(i) Next i Close #1
And that's it... I believe it should be fairly simple in Vb.Net too... Probably very similar...
Reply
Galahad
Mar 26 2007, 10:23 AM
OK, I'm sure you already found what you were looking for, but I'll post an example code, of how to write text files in VB.NET... Maybe someone in the future would find it usefull: CODE Imports System Imports System.IO
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim f As StreamWriter, i As Long, obj As Object For i = 1 To 10 ListBox1.Items.Add("Item " & i.ToString) Next i f = New StreamWriter("C:\Test.txt") For i = 0 To ListBox1.Items.Count - 1 f.WriteLine(ListBox1.Items.Item(i).ToString) Next i f.Close() End Sub End Class That's the full working code, just copy and paste it in your project, and voila... Hope it helped a bit 
Reply
Similar Topics
Keywords : save, files, txt, vb, net
- How Can You Get Audio Files From Itunes Videos?
(1)
Naming Web Page Files
Which way you like- MyPage.html or my-page.html or my_page.html (7) Everybody talks about meta tags, keywords, good title names and how they can increase page rankings,
etc. But I was wondering whether the page name itself holds any value in indexing. Yes, I am
talking about the web page file names (some-thing.html) NOT the one which you put in title tags. I
am going to express my views and want to know what you think is correct. I have seen pages named in
various ways like these: 1) my_web_page.html 2) DoYouLikeMyPage.html 3) hey-see-my-webpage.html (I
think this way is more appropriate) 4) this.is.a.page.html (somewhat confusing) ....
Audio Files?
(3) I need some help. Is it possible to get audio files off of sites? Like IMEEM and YouTube. I know the
whole http://www.file2hd.com thing. It doesn't always work though. Are there other ways? Is
there a way people hack audio files off of sites? NOTE: I DO NOT WANT DO THIS! I merely want to
know so that I can protect my sites from it. Thanks.....
Jar Executable Files
(1) I have been supplied with a digital log book for use this semester and it comes in the form of a
.jar file and a .mdb file. I tried running it on my mac but it crashes every time but it seems to
run perfectly on windows xp. Does anyone have any ideas why? I thought .jar files would be
computable on any platform. ....
Best Way To Transfer Files
I just bought a laptop (6) Hi there guys, I just bought a brand new Dell Inspiron laptop for $729.99. It has a
processing speed of 2.0ghz, 3GB RAM, and a 250gb hard drive. I'm really satisfied, especially
with the wireless internet and the fact that I can carry my computer around with me, allowing you to
use your computer in comfortable spots -- outside in the shade, on the train, or even in your bed
where I'm using it write now as I type. If you didn't already guess, this is my first
laptop. But I do have some issues. Does anyone happen to know an easy way to transfer some ....
1350 Great Free Logos (jpg + Psd)
With both jpg and original psd files to edit (7) 1350 Great Free Logos (With both jpg and psd files)
http://rapidshare.com/files/126291346/1346...Great.Logos.zip This is a great collection of
logos, they are already made logos which you can use like that or just use to create other logos, do
what you want, they are free, they came from free websites that give this logos for free and lot
more, but i just took the good ones mainly. There is also a small collection of 100 logos inside
the compressed file, which you can use to insert those graphics in your logo/design/web design
projects, do what you want with them ....
Debug Exe Files
How to debug an exe file. (4) Think that we have written a program, and some codes are wrong. We can go back to compiler and
change the code, and compile again. But I will show you how to correct our mistakes without using
the compiler. Let's start: I have written a program in Delphi. Let's see my mistake. I
have created a form like this. After this I wrote the codes in the Compare Button click as
below. CODE 1. procedure TForm1.ComparebuttonClick(Sender: TObject); 2. var
3. a,b:integer; 4. begin 5. a := StrToInt(EditA.Text); 6. b :....
Save Me!
Religious (0) During exams, with all the stress, my brain explodes, I need to turn to God for help. I've
been thinking I'm able. I've been thinking I'm good enough. I've been thinking
I'll make it on my own. I've been seeking my kingdom. I've been longing for my own
thing. I've been trying my best to take control. But without you I crumble. Without you
I'm lost. Save me, Jesus Won't you take my pride away. Save me, Jesus Today Give me
eyes that can see you Patient heart and a gentle word Love for justice, mercy, pea....
Mysql
Several files in one field. (2) Hi guys. I want t know if it is posible to have so many entries for one object in a field in MySQL.
I know my question may not be clear because I lack in terminology but pliz try and help. What I want
to do is for axample have a database of my clients with the following fields for every client:
fname, lname, more than one photos, contrubutions(comments, jokes, testimonials posted) etc. I want
to have the things like the photos in the same field but they have to be unique so that my php code
can deal with them individually llike they are coming from different fields.....
Converting Audio Files In Vista
how do you do it? (7) Ok, so I have some .wav files that I'd like converted into .mp3. I knew how to do it in XP, but
I can't find windows audio converter in Vista....does vista even have that, or is it under a new
name? Also, is it possible to convert video files, like .flv into .avi?....
Search For Video Files And Display Them
Using a batch file in windows (0) In windows you need to be able to see the file's extension so you can rename a .txt file to .bat
This batch code I wrote searches your C:\ drive for video files and drops the results into a
file. That file is then processed into links on a web-page. The web-page is then opened for you to
view. Click the links to view the file, right click -> save as to save to another place on your
computer. I use it a lot after browsing videos on the web. It's fun to see what videos end up
cached (left on the computer from browsing) Insert this into a file named vid-searc....
Deleted Some Important Files In Your Usb/ Mem Stick?
(1) if you did then use a file recovery program. there are recovery programs unique to your brand like
sony's recovery program for their memory sticks. i have heard so many people just pity
themselves because of this one.....
Save Youtube Files
(21) Hi, I'm running a tool called MelodyCan for my Napster library and recently discovered 1 perfect
feature - YouTube downloader! It allows to download YouTube videos from the site and convert to
various video formats. Install the trial version from http://www.convert-any-media.com/ and go to
your Internet Explorer. All you need is to load Youtube page with a video clip and click on "Save
Youtube video" button or something like that.. and the clip will be saved to the desired location
/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"....
Decoration
How to Decorate your house with recycle things to save your money (1) Hi, Everyone has different idea. I get wonderful idea and forget quickly. It happens all the time.
Finally, I got an idea to post my idea in the forum. I think you may be interested to know. Now, I
would like to share how I decorate my clothing cupboard. Most of the time my underwears are messed
in my cupboard. It looks really ugly when someone come and visit my room. Last week, I saw an empty
tissue box on the table. I got an idea and took that tissue box. I folded my underwears, and rolled
them as spring rolls, then put in the tissue box one by one. I could put 12 ....
How To Save Yourself From A Rape Situation?
Precautions, Self Defense, Safety Guide (13) QUOTE Source : Email - I found this information very necessary for females. How To
Save Yourself From A Rape Situation? Precautions, Self Defense, Safety Guide Through
a Rapist's Eyes This is important information for females of ALL ages . A group of
rapists and date rapists in prison were interviewed on what they look for in a potential victim and
here are some interesting facts: 1) The first thing men look for in a potential victim is
hairstyle. They are most likely to go after a woman with a ponytail, bun, braid or other ....
How To Disable "show Hidden Files And Folders" In Folder Option
(11) How to disable "Show hidden files and folders" in Folder Option As you know, you can hide files
or folders in Microsoft Windows ( to hide a file or folder , right click on file or folder >select
properties and then select Hide file) But if you open Folder Option and check "Show hidden files
and folders " you can see hidden files. to disable "Show hidden files and folders" feature follow
below steps : 1- Click start > Run > type regedit to run Windows Registry Editor. 2- Go to following
address: QUOTE HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/Current Versio....
Informix To Sql Server (or How To Open .unl Files)
how to import .unl files into SQL Server 2000 without Informix softwar (2) Does anyone know how to import .unl files into SQLServer 2000? My boss gave me this task to migrate
an old database into SQLServer. I don't have informix installed since the files were sent to me
via email. All files have .unl extension and I don't have a clue how to view them. I've
tried opening them using excel but it can't be read. Does anyone know how to do this? Or at
least know how to open/view the file using excel or any other program that could be easily migrated
to sqlserver? Please, I need to migrate the files as soon as possible. Thanks....
Flatfile User Login/signup
Uses text files only (compatable with forums and message system) (24) With this tutorial, you will learn how to create a textfile login script. This user membership
script is for use also with my forums and message system scripts. I will also give you the scripts
to make it so that people can change their profiles. Ok, The first thing we need to do is make the
database. To do this, create a blank text file called 'userdata.txt' , make sure it is ALL
LOWER-CASE. Edit this file and put
'**username|##|password|##|email|##|rank|##|userid|##|name|##|picture**'. This will not be
used, however it will give you an idea of how the....
Strange .log Files On My Desktop
(10) Since this morning, two new visitors has camped out on my desktop. One is lcapi0.log , & when you
open it you get: QUOTE 19:50:36.703 F20:F24 WARN :: module=lcapi flavor=fre
version=1.7.226.0 (RTC Version 4.3.5371.0) 19:50:38.109 F20:F24 INFO :: Initialize(0) 19:50:38.609
F20:F24 INFO :: MUI not Enabled 19:50:44.625 F20:F24 INFO :: SetDeviceDisabled 0->0 19:50:44.656
F20:F24 INFO :: SetDeviceDisabled 0->1 19:50:44.656 F20:F24 TRACE :: SetDevice 00000000->00000000
19:50:44.656 F20:F24 INFO :: SetDeviceDisabled 0->0 19:50:44.656 F20:F24 TRACE :: SetDevic....
Linux Question: Amarok And File Permissions
please help, i can't get it to work with all music files (4) hey, i use to use Linux DC++ to download music from some hubs and i usually download it to
/home/downloads/ and then i move the files to my collection on another HDD a sata one, on
sda3/music/ but when i move the files using krushader root mode they become posessed by root and
amarok can't play them displaying a locker on the file's icon. I tried to " chmod 774 music
", where music is my music directory, as root in konsole but no luck. What should i do to make a
whole directory accessible from amarok as user?....
Files With Mdf Extension
how to open them (6) please transfer this topic to a subforum if this isn't the appropriate subforum. i can't
seem to find one that might fit this topic. thanks i have downloaded a file from a torrent client
along with other files. i'm trying to figure out if the mdf file is the rip from the dvd that
i'm looking for. the problem is i don't know how to open it(the mdf file). i've looked
through the net and it says that i should use ISOBuster. i've tried it but i don't know
exactly the steps on extracting the files on the mdf file. any help would be appreciate....
The Icons Of Zip Files Are Wrong Everytime!
Windows 2000 (3) Hello! I am going crazy for a silly little thing. Please help me anyone! The icon for
ZIP files never shows the way it is supposed to. Instead it insists on displaying the Windows
'default document' icon for ZIP files. If I rightclick a zip and choose icon properties, I
can set the icon to be fetched from the winzip executable instead, and all looks fine and dandy
inside the properties dialog, but after refreshing or repairing icon cache it is still the default
document icon that is displayed. If I try to change the icon enough times it will ev....
How To Save *.swf From A Web Site?
freeware or shareware... (29) Greetings, Does anyone know how to grab *.SWF file from web? I've found one software named
LIATRO SWF DECODER.. anyone have tried it? Is it good? Thanks /biggrin.gif' border='0'
style='vertical-align:middle' alt='biggrin.gif' /> ....
Need 4 Speed Underground 2
save game (3) Does anybody know how you save your game in need 4 speed underground 2 on th game boy advance SP,
because i cant find a save option. i dont no whether or not if its the game i bought as i got it
from turkey, and most of them are copies. Its really anoying me because i keep getting so far, but
then the power runs out, and i have to start again.....
Css And Javascript Combined For Dynamic Layout
use of different CSS files at same site (9) This tutorial is meant for people that are dealing with problems while coding their site at 100% of
width. Important notice: Some people has JavaScript disabled, so they will not be able to load CSS
file (take this in account when creating your website). How this script works. In the HEAD of your
HTML document will apply this command, so variable.js file will be load at start: CODE
<script type="text/javascript" src="variable.js"></script> In
browser JavaScript file variable.js is loaded. This Javascript file consist of this para....
Xbox-save-games
(11) I am curious as to how you get a save game off the Xbox hard drive and onto a computer. I am sure
that brienj could answer this. I am assuming by somehow browsing the network to find the Xbox hard
drive. Is there a tool needed to do this? I am assuming that the Xbox drive is hidden to normal
network browsing.....
Does Anyone Know How To Make Exe Files
(17) Does anyone know any software for making exe files, I want to make simple programs not propper
one's. Thanks.....
Defragment: Cannot Defrag All Fragmented Files
What can I do about this? (9) This is what I get after I defrag, "all files could not be defragged". I think this is slowing
down my computer, so what can I do? I have a couple movies on my hard drive that are about 700MB
and 900MB. Does this have something to do with this big red area? Thanks.....
Getting List Of Directories And Files Using Php
PHP Function for Directory and File List (6) is there a php function that lists the content of some folder.... example: /New folder new.txt
left.gif download.zip dc.exe ....so is there..? /rolleyes.gif' border='0'
style='vertical-align:middle' alt='rolleyes.gif' /> ....
Converting Video Files From One Format To Another
help plz :) (6) hey i have learnt this nice way to open mov files in imageready and insert them in sigs,graphics and
other stuff its really cool,this only works with .mov files and i really need to know if sumone here
can do that,i need to change a wmv file into a .mov file so i cant add the movie to a sig,i have
tried many video format conversion programs but they dont accept the mov format,the mov format is a
quicktime video format,so anyone here know how to change a video file into a quicktime mov video
format? thnx in advance....
Looking for save, files, txt, vb, net
|
|
Searching Video's for save, files, txt, vb, net
|
advertisement
|
|