Click here to Skip to main content
15,908,775 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to programatically create a text file containing the VB.Net code neccessary for recreating a different file programatically Pin
Nadroj6-Apr-04 3:01
Nadroj6-Apr-04 3:01 
AnswerRe: How to programatically create a text file containing the VB.Net code neccessary for recreating a different file programatically Pin
Dave Kreskowiak6-Apr-04 0:56
mveDave Kreskowiak6-Apr-04 0:56 
GeneralRe: How to programatically create a text file containing the VB.Net code neccessary for recreating a different file programatically Pin
Codemonkey856-Apr-04 11:50
Codemonkey856-Apr-04 11:50 
GeneralRe: How to programatically create a text file containing the VB.Net code neccessary for recreating a different file programatically Pin
Nadroj6-Apr-04 11:52
Nadroj6-Apr-04 11:52 
GeneralRe: How to programatically create a text file containing the VB.Net code neccessary for recreating a different file programatically Pin
Codemonkey856-Apr-04 16:38
Codemonkey856-Apr-04 16:38 
GeneralSerializing Pin
Anonymous5-Apr-04 4:51
Anonymous5-Apr-04 4:51 
GeneralRe: Serializing Pin
Alberto Venditti5-Apr-04 21:12
Alberto Venditti5-Apr-04 21:12 
GeneralRe: Serializing Pin
Randy S6-Apr-04 15:01
Randy S6-Apr-04 15:01 
I would just save toa text file. Then you could read from the file to restore the valus. It is easy. You need System.io an duse stream reader and stream writer.
I have a logon form which is check for a saved user name from a file at load. And on Enter I save the user name to this same file. That way the user name is remembered when the program is ended and then restarted.
Ex. ( sName4User is global variable,
Private Sub frmLogon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' This will retreive a user name from file if present.
' Opens a file stream for reading
Dim myFS As New FileStream("c:\winnt\Temp\User.txt", FileMode.OpenOrCreate, FileAccess.Read, FileShare.None)
Dim myReader As New StreamReader(myFS) ' Assigning a reader
sName4User = myReader.ReadLine 'Retreives username
If Not sName4User Is Nothing Then
txtName.Text = sName4User
End If
myReader.Close()
End Sub

Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
'Storing username to file and closing if a username was entered
If txtName.Text <> "" Then
sName4User = txtName.Text
' Opens a file stream for reading
Dim myFS As New FileStream("C:\winnt\Temp\User.txt", FileMode.OpenOrCreate)
Dim myWriter As New StreamWriter(myFS) ' Assinging a reader
myWriter.WriteLine(sName4User) ' Storing to the file
myWriter.Close()
Me.DialogResult = DialogResult.OK
Else
txtName.Text = "Enter a user name"
txtName.Focus()
txtName.SelectAll()
End If
End Sub
GeneralApplication with Socket Programming Pin
rajamca20034-Apr-04 20:39
rajamca20034-Apr-04 20:39 
GeneralRe: Application with Socket Programming Pin
adarsh_m4-Apr-04 23:44
adarsh_m4-Apr-04 23:44 
GeneralClickety Pin
Colin Angus Mackay5-Apr-04 0:22
Colin Angus Mackay5-Apr-04 0:22 
GeneralCopying a class (copy constructor) Pin
PaleyX4-Apr-04 12:29
PaleyX4-Apr-04 12:29 
GeneralRe: Copying a class (copy constructor) Pin
Dave Kreskowiak4-Apr-04 17:47
mveDave Kreskowiak4-Apr-04 17:47 
GeneralDependency problems in deploying a VB.Net Application Pin
nvmoss4-Apr-04 9:01
nvmoss4-Apr-04 9:01 
GeneralRe: Dependency problems in deploying a VB.Net Application Pin
Wayne Phipps4-Apr-04 9:08
Wayne Phipps4-Apr-04 9:08 
GeneralUsing NetworkStream Pin
Wayne Phipps4-Apr-04 8:02
Wayne Phipps4-Apr-04 8:02 
Generalvb net Pin
timark4-Apr-04 5:28
timark4-Apr-04 5:28 
GeneralRe: vb net Pin
Dave Kreskowiak4-Apr-04 17:52
mveDave Kreskowiak4-Apr-04 17:52 
GeneralXML and VB.NET Pin
PaleyX3-Apr-04 10:35
PaleyX3-Apr-04 10:35 
GeneralRe: XML and VB.NET Pin
PaleyX4-Apr-04 3:07
PaleyX4-Apr-04 3:07 
Questionhow to print out the content of picturebox and richtexbox using print dialog? Pin
MJay3-Apr-04 3:02
MJay3-Apr-04 3:02 
AnswerRe: how to print out the content of picturebox and richtexbox using print dialog? Pin
Ricci Gian Maria4-Apr-04 21:19
Ricci Gian Maria4-Apr-04 21:19 
GeneralData load for Winsock Client Pin
DhruboMitra2-Apr-04 19:43
DhruboMitra2-Apr-04 19:43 
GeneralRe: Data load for Winsock Client Pin
Dave Kreskowiak3-Apr-04 2:05
mveDave Kreskowiak3-Apr-04 2:05 
GeneralRe: Data load for Winsock Client Pin
DhruboMitra8-Apr-04 18:09
DhruboMitra8-Apr-04 18:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.