Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 05:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Pk2 Text Reader Error[HELP]

Discussion on Pk2 Text Reader Error[HELP] within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2018
Posts: 15
Received Thanks: 1
Question Pk2 Text Reader Error[HELP]

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

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

risesun97 is offline  
Old 03/01/2021, 08:55   #2
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 421
Received Thanks: 953
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");

Attached Files
File Type: rar Pk2ReaderAPI.rar (3.9 KB, 92 views)
JellyBitz is offline  
Old 03/02/2021, 02:44   #3
 
elite*gold: 0
Join Date: Apr 2018
Posts: 15
Received Thanks: 1
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;

risesun97 is offline  
Old 03/02/2021, 03:20   #4
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 421
Received Thanks: 953
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"
JellyBitz is offline  
Old 03/02/2021, 12:21   #5
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
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")) 
#HB is offline  
Old 03/02/2021, 14:05   #6
 
elite*gold: 0
Join Date: Apr 2018
Posts: 15
Received Thanks: 1
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.
risesun97 is offline  
Old 03/02/2021, 22:15   #7
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
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.
#HB is offline  
Old 03/02/2021, 23:24   #8
 
elite*gold: 0
Join Date: Apr 2018
Posts: 15
Received Thanks: 1
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:



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:

risesun97 is offline  
Old 03/02/2021, 23:31   #9
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,110
Received Thanks: 907
Quote:
Originally Posted by risesun97 View Post
Your paths are obviously all incorrect. I'm surprised you couldn't even copy Jelly's textuisystem path example correctly.
#HB is offline  
Old 03/03/2021, 00:08   #10
 
elite*gold: 0
Join Date: Apr 2018
Posts: 15
Received Thanks: 1
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?
risesun97 is offline  
Reply

Tags
pk2 read error


Similar Threads Similar Threads
Pk2 Writer, Pk2 Import, Pk2 'ye Dosya Gömme[Help]
02/15/2021 - SRO Coding Corner - 5 Replies
Hello Everyone, I want to do import file(like ipinput) in to media.pk from using my project but i need Pk2 Writer. I found Pk2 Reader but want to import file in to media pk automatically with button. How i can do it? Can anyone help me?
Reader with Foxit PDF reader is not faulty?
04/18/2014 - Technical Support - 0 Replies
Today I read a file into PDF with Foxit Reader software that error message "D: \ study \ ***********.pdf Couldnot open file. File not found " This error alone today because last week my newly found normal users do not see the error. I tried many PDF files are so off. I brought it to another computer open. You know how to help me see this error!
New media.pk2 Data.pk2 Particles.pk with Devil Spirit el Devil Spirit Edit PK2 Swsro1
01/22/2011 - SRO Private Server - 15 Replies
Well here I brought my contribution was working when it was the devil spirit Data *- Translated into English 100% *- Uniques Spawn, the uniques great x5 *- Mp ~ Hp Bar New *- Lv of Mobs *- AutoSelect *- Versek purple, blue



All times are GMT +1. The time now is 05:23.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.