Pk2 Text Reader Error[HELP]

03/01/2021 03:11 risesun97#1
Hello everyone,

I working read txt data in media.pk but i getting error. Can anyone know how to use - GetFileText(string Name) --> string (+1 overflow) method. Please give me example.

I using this project [Only registered and activated users can see links. Click Here To Register...]

I want to read txt data in media.pk on console. Can any one help me?

[Only registered and activated users can see links. Click Here To Register...]
03/01/2021 08:55 JellyBitz#2
I recommend you to use my Pk2 Reader class for performance reasons.

PHP Code:
using(var pk2Reader = new Pk2Reader("C://Silkroad/Media.pk2","169841"))
{
    
string text pk2Reader.GetFileText("Type.txt");

03/02/2021 02:44 risesun97#3
Quote:
Originally Posted by JellyBitz View Post
I recommend you to use my Pk2 Reader class for performance reasons.

PHP Code:
using(var pk2Reader = new Pk2Reader("C://Silkroad/Media.pk2","169841"))
{
    
string text pk2Reader.GetFileText("Type.txt");

I try your project but i getting same error again.

I still getting error. Its give me message it "System.NullReferenceException: 'Object reference not set to mention of an object.'

file was null.

This is picture;

[Only registered and activated users can see links. Click Here To Register...]
03/02/2021 03:20 JellyBitz#4
Quote:
Originally Posted by risesun97 View Post
file was null.
If you get a null file there is because the path provided doesn't exists into the pk2 file or probably bad written.

Pk2 path example: "server_dep/silkroad/textdata/textuisystem.txt"
03/02/2021 12:21 #HB#5
I think its a mistake in media path example you showed him, should be:

Quote:
Originally Posted by JellyBitz View Post
PHP Code:
using(var pk2Reader = new Pk2Reader("C:\\Silkroad\\Media.pk2","169841")) 
or

PHP Code:
using(var pk2Reader = new Pk2Reader(@"C:\Silkroad\Media.pk2","169841")) 
03/02/2021 14:05 risesun97#6
Quote:
Originally Posted by JellyBitz View Post
If you get a null file there is because the path provided doesn't exists into the pk2 file or probably bad written.

Pk2 path example: "server_dep/silkroad/textdata/textuisystem.txt"
Oh bro i was used this symbol '\' always. I will try this symbol '/' .

Quote:
Originally Posted by #HB View Post
I think its a mistake in media path example you showed him, should be:
I think both example are same method.
03/02/2021 22:15 #HB#7
Quote:
Originally Posted by risesun97 View Post
I think both example are same method.
If you mean my example, then yeah, that's what I said OR.

Jelly's example above had a little mistake, I think.
03/02/2021 23:24 risesun97#8
Quote:
Originally Posted by #HB View Post
I think its a mistake in media path example you showed him, should be:
Yours method give error before execute.

This:

[Only registered and activated users can see links. Click Here To Register...]

Quote:
Originally Posted by JellyBitz View Post
If you get a null file there is because the path provided doesn't exists into the pk2 file or probably bad written.

Pk2 path example: "server_dep/silkroad/textdata/textuisystem.txt"
My method give same error 'file was null', whats mean this error i cant understand. Do you look error on my code?

This:

[Only registered and activated users can see links. Click Here To Register...]
03/02/2021 23:31 #HB#9
Quote:
Originally Posted by risesun97 View Post
[Only registered and activated users can see links. Click Here To Register...]
Your paths are obviously all incorrect. I'm surprised you couldn't even copy Jelly's textuisystem path example correctly.
03/03/2021 00:08 risesun97#10
Quote:
Originally Posted by #HB View Post
Your paths are obviously all incorrect. I'm surprised you couldn't even copy Jelly's textuisystem path example correctly.
That's not the problem. It gives error in its way. Why underlined red stripes? Could you write the correct one please?