title image


Smiley Re: VB.NET 2005 "app.config" mehrdimensionale Variablen (Arrays)
In Project Settings Name wie "Array1" und Type eingeben (du kannst browsen für Types wie ArrayList). Mit ArrayList zb kannst du deine Daten so speichern





Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

Dim arlst As New ArrayList

For Each strn As String In ListBox1.Items

arlst.Add(strn)

Next

My.Settings.Array1 = arlst

End Sub



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim arlst As ArrayList = My.Settings.Array1

If arlst Is Nothing Then

ListBox1.Items.Add ("item#1")

ListBox1.Items.Add("item#2")

Else

For Each strn As String In arlst

ListBox1.Items.Add(strn)

Next

End If

End Sub





geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: