1.

Solve : Visual Basic 2008: Writing and Reading?

Answer»

Hey guys, I know you're all really helpfull in the MS-DOS section, let's just hope that's the same here.

What I'm trying to do is:

1. Display the entire contents of a file (could be over 100 lines) and refresh every second or so
2. Append text from a textbox to the end of that file.

I just got Visual Basic 2008 because my friend says it's really easy, but I'm not that good. So far, I have a regular textbox (textbox1), which is where I would append the text, a read-only, multi-line textbox (textbox2), which is what I want to display the file contents and a button (button1) which would append textbox1.text to my file.


Is this even possible? If so, could you SHOW me how to do it?I'm not quite sure I understand want you want. From I gather, you want to read in from a text file every second. Then, any text that appears in textbox1, would be ADDED to the end of the text file, right? Are you hard coding the name of the text file or will you select it from a dialog window? How do you want the text in textbox1 to be added to the file, automatically or with a button? This is certainly possible. You'll just need to use a timer that is set to 1 second.Quote from: lordvader781 on April 07, 2009, 02:38:36 PM

I'm not quite sure I understand want you want. From I gather, you want to read in from a text file every second. Then, any text that appears in textbox1, would be added to the end of the text file, right? Are you hard coding the name of the text file or will you select it from a dialog window? How do you want the text in textbox1 to be added to the file, automatically or with a button? This is certainly possible. You'll just need to use a timer that is set to 1 second.

You're right about what I want to do, and the file will be hard coded into the code (imtp.txt). And as I said before, button1 will send textbox1.text to the file.

The only code that I've actually managed to do is change the text of a label on a button click...so this is a bit advanced.I'd post a VB6 equivalent but it would probably be a Pain to convert to .NET; I don't think .NET has the VB6 file access functions/statements.Quote from: BC_Programmer on April 07, 2009, 04:56:18 PM
I'd post a VB6 equivalent but it would probably be a Pain to convert to .NET; I don't think .NET has the VB6 file access functions/statements.

I'm a bit confused. If I make the program into a .exe in VB2008, will someone need .NET to run it? I don't think the people who will be using this have it...yes, they will need the .NET framework installed to run any applications created in Visual Basic .NET, C# or Managed C++.OK...that is a major setback...


Is there any way that they WON'T have to do that in VB2008?
If no, is there any way I can make it WITHOUT them downloading .NET? They can't get it...as deepfreeze will just restore it.well, I don't think it's possible- since the forms, buttons, etc are all stored in the .NET framework winforms library. IN fact- the entire program is just a .NET component (assembly) and so needs the .NET loader, mscoree.dll to be present.

now if you can get a HOLD of a COPY of an earlier version of Visual Basic, the runtimes for those won't be an issue- they are included in Windows 98SE, windows XP and windows Vista.

Unfortunately although there is a "Learning edition" of VB6 it doesn't allow the compiling of executables




Quote from: BC_Programmer on April 07, 2009, 05:52:20 PM
well, I don't think it's possible- since the forms, buttons, etc are all stored in the .NET framework winforms library. IN fact- the entire program is just a .NET component (assembly) and so needs the .NET loader, mscoree.dll to be present.

now if you can get a hold of a copy of an earlier version of Visual Basic, the runtimes for those won't be an issue- they are included in Windows 98SE, windows XP and windows Vista.

Unfortunately although there is a "Learning edition" of VB6 it doesn't allow the compiling of executables






Grr...And it's against the rules for you to provide me with VB6...

I have WinXPsp2...(for some reason I can't update to SP3)...


Discussion

No Comment Found