Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.Web
- Imports System.Net
- Imports System.IO
- Module setting
- 'Public Class checks
- Dim direct As String = My.Application.Info.DirectoryPath & "/"
- Dim settings(4) As Integer
- Dim count As Integer = 0
- Dim download As WebClient = New WebClient
- Const filelink As String = ("https://dl.dropbox.com/s/bhf2j1wrbe612zh/TestFile.bin?dl=0")
- Const filename As String = ("TestFile.bin")
- Public Async Sub getcheck()
- Try
- If System.IO.File.Exists(direct & "TestFile.bin") Then
- Using sr As StreamReader = New StreamReader(direct & "TestFile.bin")
- Dim line = Await sr.ReadToEndAsync()
- sr.Close()
- Dim lineL As Integer
- Dim search As String
- 'MsgBox(line & ControlChars.NewLine & line.Length)
- For i = 1 To line.Length - 1
- lineL = (line.Length - i)
- search = (line(line.Length - lineL))
- 'If count > 5 Then
- 'ReDim settings(count)
- 'End If
- If search = "[" Then
- lineL = (line.Length - i) - 1
- search = (line(line.Length - lineL))
- settings(count) = search
- 'MsgBox(settings(count))
- count += 1
- End If
- Next
- count = 0
- End Using
- Else
- download.DownloadFile(filelink, filename)
- Call getcheck()
- End If
- Catch
- MsgBox("fail")
- End Try
- End Sub
- Public Function getsetting(ByVal xpass As Integer) As Integer
- Return settings(xpass)
- End Function
- 'End Class
- End Module
Advertisement
Add Comment
Please, Sign In to add comment