V
vmars316
Guest
Hello & Thanks ;
Win 10 , VS vb.net
In code below I am getting two Errors:
On line 6:
Severity Code Description Project File Line Suppression State
Error BC30201 Expression expected. CompareTxtBox-TxtFile C:\Users\vmars\source\repos\CompareTxtBox-TxtFile\Form1.vb 6 Active
on line 12:
Severity Code Description Project File Line Suppression State
Error BC30002 Type 'StreamReader' is not defined. CompareTxtBox-TxtFile C:\Users\vmars\source\repos\CompareTxtBox-TxtFile\Form1.vb 12 Active
What is compiler looking for and & How to resolve it .
Thanks for your help...
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim strTxtName As String
MessageBox.Show("Here we go: to Compare Link with SafeSites.txt")
strTxtName = ("SafeSites.txt")
Call IsExistString(ByVal strTxtName As String)
End Sub
Private Function IsExistString(ByVal strTxtName As String) As Boolean
Dim isExist As Boolean = False
Dim str As String = "DuckDuckGo — Privacy, simplified."
Dim nLength As Integer = str.Length
Dim sr As StreamReader = New StreamReader(steFilePath & strTxtName)
Dim strLine As String = sr.ReadToEnd()
If strLine.Length >= nLength Then
For i As Integer = 0 To strLine.Length - nLength - 1
If Equals(strLine.Substring(i, nLength), str) Then
isExist = True
Exit For
End If
Next
Else
isExist = False
End If
sr.Close()
Return isExist
End Function
End Class
"All things in moderation, except for love and forgiveness."...vm
Continue reading...
Win 10 , VS vb.net
In code below I am getting two Errors:
On line 6:
Severity Code Description Project File Line Suppression State
Error BC30201 Expression expected. CompareTxtBox-TxtFile C:\Users\vmars\source\repos\CompareTxtBox-TxtFile\Form1.vb 6 Active
on line 12:
Severity Code Description Project File Line Suppression State
Error BC30002 Type 'StreamReader' is not defined. CompareTxtBox-TxtFile C:\Users\vmars\source\repos\CompareTxtBox-TxtFile\Form1.vb 12 Active
What is compiler looking for and & How to resolve it .
Thanks for your help...
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim strTxtName As String
MessageBox.Show("Here we go: to Compare Link with SafeSites.txt")
strTxtName = ("SafeSites.txt")
Call IsExistString(ByVal strTxtName As String)
End Sub
Private Function IsExistString(ByVal strTxtName As String) As Boolean
Dim isExist As Boolean = False
Dim str As String = "DuckDuckGo — Privacy, simplified."
Dim nLength As Integer = str.Length
Dim sr As StreamReader = New StreamReader(steFilePath & strTxtName)
Dim strLine As String = sr.ReadToEnd()
If strLine.Length >= nLength Then
For i As Integer = 0 To strLine.Length - nLength - 1
If Equals(strLine.Substring(i, nLength), str) Then
isExist = True
Exit For
End If
Next
Else
isExist = False
End If
sr.Close()
Return isExist
End Function
End Class
"All things in moderation, except for love and forgiveness."...vm
Continue reading...