Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

AddListSave

By: a guest on Jul 13th, 2013  |  syntax: VB.NET  |  size: 2.22 KB  |  hits: 57  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 'Coded By : Dr.EvilCoderSc
  2. 'Explained By : Dr.EvilCoderSc
  3. 'From : Dev-Point.Com
  4. Public Class Form1
  5.  
  6.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  7.         ListBox1.Items.Add(TextBox1.Text) 'إضافة Item للست بوكس
  8.         If IO.File.Exists(System.AppDomain.CurrentDomain.BaseDirectory & "\list.txt") Then 'إذا تواجد ملف معلومات اللست قم بـ
  9.             Dim listati As String = System.IO.File.ReadAllText(System.AppDomain.CurrentDomain.BaseDirectory & "\list.txt") 'إنشاء متغير يحتوي معلومات اللست
  10.             System.IO.File.WriteAllText(System.AppDomain.CurrentDomain.BaseDirectory & "\list.txt", listati & "0x0x0x0" & TextBox1.Text) 'الكتابة على معلومات اللست بالمعلومات الجديدة
  11.             TextBox1.Text = ""  'إفراغ التكست بوكس
  12.         Else 'غير ذلك
  13.             System.IO.File.WriteAllText(System.AppDomain.CurrentDomain.BaseDirectory & "\list.txt", "0x0x0x0" & TextBox1.Text) ' قم بكتابة المعلومات الجديدة في ملف list.txt
  14.             TextBox1.Text = "" 'إفراغ التكست بوكس
  15.         End If 'إنهاء الشرط
  16.     End Sub
  17.  
  18.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  19.         If IO.File.Exists(System.AppDomain.CurrentDomain.BaseDirectory & "\list.txt") Then 'إذا تواجد ملف معلومات اللست قم بـ
  20.             Dim listat As String = System.IO.File.ReadAllText(System.AppDomain.CurrentDomain.BaseDirectory & "\list.txt") 'إنشاء متغير وجلب المعلومات التي في الملف
  21.             Try 'حاول القيام بـ
  22.                 For i = 0 To 100000000 'قيمة i تساوي من 0 إلى 100000000
  23.                     ListBox1.Items.Add(Split(listat, "0x0x0x0")(i)) 'إضافة Item للست بوكس بتقسيم المعلومات
  24.                     'السبلتة تكون بالفاصل : 0x0x0x0
  25.                 Next 'التالي
  26.             Catch ex As Exception 'إذا حدث خطأ قم بـ
  27.                 'لا شيء
  28.             End Try ' إنهاء المحاولة
  29.         End If  'إنهائ الشرط
  30.  
  31.     End Sub
  32. End Class