Read text from .dat file?
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Agust1337 wrote:Hello DarkyKnife,Hi August, the code is not working, i get error while running program in line
I haven't tried this code, but here:Code: Select allDim fInfo As New FileInfo("servercache.dat") Dim numBytes As Long = fInfo.Length Dim fStream As New FileStream("servercache.dat", FileMode.Open, FileAccess.Read) Dim br As New BinaryReader(fStream) Dim data As Char() = br.ReadChars(CInt(numBytes)) 'Dim data As Byte() = br.ReadBytes(CInt(numBytes)) Dim test As String = "" For i = 0 To 5000 test += Convert.ToString(data(i)) Next MsgBox(test) br.Close() fStream.Close()
Code: Select all
test += Convert.ToString(data(i))
and it says
Code: Select all
Index was outside the bounds of the array.
Hmm Okay, try opening it in the debug folder not through vb.
This minecraft game may use a specific format for stored text, if thats the case you will have to figure out the file structure.
You could search through the file to match patterns of unicode/ASCII text if that is what you are after.
You could search through the file to match patterns of unicode/ASCII text if that is what you are after.
Agust1337 wrote:Hmm Okay, try opening it in the debug folder not through vb.I get the same message when i open not in VB
You need to change the 5000 to the length of the file(characters).
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
mandai wrote:This minecraft game may use a specific format for stored text, if thats the case you will have to figure out the file structure.Mandai, check these links:
You could search through the file to match patterns of unicode/ASCII text if that is what you are after.
http://www.minecraft.net/docs/levelformat.jsp
http://www.minecraft.net/docs/NBT.txt
Hope it helped!
Last bumped by GoodGuy17 on Thu Jan 20, 2011 12:29 am.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023