Code:
Private Sub readIni()
Dim oRead As System.IO.StreamReader
Dim oWrite As System.IO.StreamWriter
Dim strIniLine, strExePath As String
'Provera da li postoji "miskopisko.ini"
If Not System.IO.File.Exists("miskopisko.ini") Then
oWrite = System.IO.File.CreateText("miskopisko.ini")
oWrite.WriteLine("[ExePath]D:\miskopisko\miskopisko.exe")
oWrite.Close()
End If
'Citam vrednosti iz "miskopisko.ini"
oRead = IO.File.OpenText("miskopisko.ini")
Do While oRead.Peek <> -1
strIniLine = oRead.ReadLine()
If strIniLine.Contains("[ExePath]") Then
strExePath = strIniLine.Substring(8)
End If
Loop
End Sub
Private Sub readIni()
Dim oRead As System.IO.StreamReader
Dim oWrite As System.IO.StreamWriter
Dim strIniLine, strExePath As String
'Provera da li postoji "miskopisko.ini"
If Not System.IO.File.Exists("miskopisko.ini") Then
oWrite = System.IO.File.CreateText("miskopisko.ini")
oWrite.WriteLine("[ExePath]D:\miskopisko\miskopisko.exe")
oWrite.Close()
End If
'Citam vrednosti iz "miskopisko.ini"
oRead = IO.File.OpenText("miskopisko.ini")
Do While oRead.Peek <> -1
strIniLine = oRead.ReadLine()
If strIniLine.Contains("[ExePath]") Then
strExePath = strIniLine.Substring(8)
End If
Loop
End Sub
Interesuje me da li ovaj zadnji "If" mogu da zamenim sa Select Case posto cu u ovom ini-ju imati jos desetak setovanja pa bi bilo lepse sa Select-om nego sa ElseIf-ovima, ali donji kod mi ne radi a na web-u ne nalazim slicne primere.
Code:
Select Case strIniLine
Case strIniLine.Contains("[ExePath]")
strExePath = strIniLine.Substring(8)
End Select
Select Case strIniLine
Case strIniLine.Contains("[ExePath]")
strExePath = strIniLine.Substring(8)
End Select
Hvala unapred.