Guest User

settings tab

a guest
Jun 4th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.92 KB | None | 0 0
  1. Imports System
  2. Imports System.Web
  3. Imports System.Net
  4. Imports System.IO
  5. Module setting
  6.     'Public Class checks
  7.     Dim direct As String = My.Application.Info.DirectoryPath & "/"
  8.     Dim settings(4) As Integer
  9.     Dim count As Integer = 0
  10.     Dim download As WebClient = New WebClient
  11.     Const filelink As String = ("https://dl.dropbox.com/s/bhf2j1wrbe612zh/TestFile.bin?dl=0")
  12.     Const filename As String = ("TestFile.bin")
  13.     Public Async Sub getcheck()
  14.         Try
  15.             If System.IO.File.Exists(direct & "TestFile.bin") Then
  16.  
  17.                 Using sr As StreamReader = New StreamReader(direct & "TestFile.bin")
  18.                     Dim line = Await sr.ReadToEndAsync()
  19.                     sr.Close()
  20.                     Dim lineL As Integer
  21.                     Dim search As String
  22.                     'MsgBox(line & ControlChars.NewLine & line.Length)
  23.                     For i = 1 To line.Length - 1
  24.                         lineL = (line.Length - i)
  25.                         search = (line(line.Length - lineL))
  26.                         'If count > 5 Then
  27.                         'ReDim settings(count)
  28.                         'End If
  29.                         If search = "[" Then
  30.                             lineL = (line.Length - i) - 1
  31.                             search = (line(line.Length - lineL))
  32.                             settings(count) = search
  33.                             'MsgBox(settings(count))
  34.                             count += 1
  35.                         End If
  36.                     Next
  37.                     count = 0
  38.                 End Using
  39.             Else
  40.                 download.DownloadFile(filelink, filename)
  41.                 Call getcheck()
  42.             End If
  43.         Catch
  44.             MsgBox("fail")
  45.         End Try
  46.     End Sub
  47.     Public Function getsetting(ByVal xpass As Integer) As Integer
  48.  
  49.         Return settings(xpass)
  50.     End Function
  51.  
  52.     'End Class
  53. End Module
Advertisement
Add Comment
Please, Sign In to add comment