[Help] with import a file using PK2Writer.dll

02/09/2018 09:44 Mr.Awesome1337#1
I'm trying to import a file using PK2Writer.dll but nothing is happend

here is the code:
Code:
            PK2Writer.Initialize(Environment.CurrentDirectory + @"\GFXFileManager.dll");
            PK2Writer.Open(Environment.CurrentDirectory + @"\Media.pk2", "169841", 6);
            PK2Writer.ImportFile(Environment.CurrentDirectory + @"Media\server_dep\silkroad\textdata\itemdata_25000.txt", "itemdata_25000.txt");
            PK2Writer.Close();
            PK2Writer.Deinitialize();
            Console.WriteLine("Done");
and i try to change the path of GFx dll or write any name to test if the code is working or not but it give me Done if i wrote any name or invaild path
02/10/2018 20:44 #HB#2
You can use the function try & catch to know where the problem is just like this:

Code:
try
{
 PK2Writer.Initialize(Environment.CurrentDirectory + @"\GFXFileManager.dll");
            PK2Writer.Open(Environment.CurrentDirectory + @"\Media.pk2", "169841", 6);
            PK2Writer.ImportFile(Environment.CurrentDirectory + @"Media\server_dep\silkroad\textdata\itemdata_25000.txt", "itemdata_25000.txt");
            PK2Writer.Close();
            PK2Writer.Deinitialize();
            Console.WriteLine("Done");
}
catch (Exception ex) { Console.WriteLine("Catched a problem:" + Convert.ToString(ex)); }
02/11/2018 16:19 Mr.Awesome1337#3
Quote:
Originally Posted by #HB View Post
You can use the function try & catch to know where's the problem just like this:

Code:
try
{
 PK2Writer.Initialize(Environment.CurrentDirectory + @"\GFXFileManager.dll");
            PK2Writer.Open(Environment.CurrentDirectory + @"\Media.pk2", "169841", 6);
            PK2Writer.ImportFile(Environment.CurrentDirectory + @"Media\server_dep\silkroad\textdata\itemdata_25000.txt", "itemdata_25000.txt");
            PK2Writer.Close();
            PK2Writer.Deinitialize();
            Console.WriteLine("Done");
}
catch (Exception ex) { Console.WriteLine("Catched a problem:" + Convert.ToString(ex)); }
Same didn't give me an error
02/12/2018 17:15 #HB#4
Why is the section so dead :v
02/13/2018 10:34 Mr.Awesome1337#5
Quote:
Originally Posted by #HB View Post
Why is the section so dead :v
Always sleeping
02/13/2018 18:28 florian0#6
Your import command is wrong.
Code:
PK2Writer.ImportFile("path\\and\\file\\in\\container\\itemdata.txt, "path\\and\\file\\on\\local\\disk\\itemdata.txt);
Change your first argument to be the path in the pk2 and your second argument to point to the file on your disk.
02/14/2018 16:41 Mr.Awesome1337#7
Quote:
Originally Posted by florian0 View Post
Your import command is wrong.
Code:
PK2Writer.ImportFile("path\\and\\file\\in\\container\\itemdata.txt, "path\\and\\file\\on\\local\\disk\\itemdata.txt);
Change your first argument to be the path in the pk2 and your second argument to point to the file on your disk.
Thanks.. So much
##Solved