Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim streamf As New System.IO.StreamReader("C:UsersZan and PolDesktopMinecraftMinecraftbinReleaseconfig.txt")
- Dim derp As String = streamf.ReadToEnd
- Dim r As New Regex("Mappath = .*")
- Dim randomstring As String = "Mappath = willitwork.ini"
- Dim mappath As MatchCollection = r.Matches(randomstring) ' When changed to derp doesn't work. Derp does work when you put it in a message box too. I tried .tostring.)
- Dim dherp(1) As String
- For Each mappaths As Match In mappath
- dherp = mappaths.ToString().Split("= ")
- MsgBox(dherp(1))
- Next
- Imports System
- Imports System.Text
- Imports System.Text.RegularExpressions
- Imports System.IO
- Public class example
- Public shared sub Main()
- Dim sb As StringBuilder = new StringBuilder()
- sb.AppendLine( "leading junk" )
- sb.AppendLine( "Mappath = willitwork.ini" )
- sb.AppendLine( "Mappath = works.ini" )
- sb.AppendLine( "trailing junk" )
- Dim ms As MemoryStream = New MemoryStream()
- ms.Write(System.Text.Encoding.UTF8.GetBytes(sb.ToString()), 0, sb.tostring().length)
- ms.Seek(0, SeekOrigin.Begin)
- Dim streamf As StreamReader = New StreamReader(ms)
- Dim derp As String
- derp = streamf.ReadToEnd
- Dim r As New Regex("Mappath = .*")
- Dim randomstring As String = sb.tostring()
- Dim mappath As MatchCollection = r.Matches(derp)
- Dim dherp(1) As String
- For Each mappaths As Match In mappath
- dherp = mappaths.ToString().Split("= ")
- Console.WriteLine(dherp(1))
- Next
- End Sub
- End class
Add Comment
Please, Sign In to add comment