Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

How to read an external resource in C# [Added in resource hacker]

Hi, I was wondering if it's possible to read a resource, post build of original exe, say in the exe you try to find a text file you added in resource hacker and read it as a string. Thanks
PHP Code

<?php 
// Example #1
        // Read the file as one string.
     
  
string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");

 
// Example #2
        // Read each line of the file into a string array. Each element
        // of the array is one line of the file.
       
 
string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Public\TestFolder\WriteLines2.txt"); 
Is that what your asking for?

Kind regards 🤝
(Dec 31, 2015 11:29 AM)GuRuHaX Wrote:  -code-
Is that what your asking for?

Kind regards 🤝

Thats not reading a resource at all.
OP, You are probaby looking for native resource, have a look at his: https://gist.github.com/BahNahNah/e30f7e45b7a2f3c91160
Usage:
Code
string myString = NativeResource.ReadResourceString("nameofresource");
Lotta blood to let, peace to make, give a fuk about a check


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by Cesar MoralesSep 20, 2015 04:34 AM 5 142 Sep 20, 2015 04:34 AM
Last Post: Menalix
[Java] by JavaProfitJul 9, 2015 02:10 AM 1 117 Jul 9, 2015 02:10 AM
Last Post: MrOrang
[.NET] by MagoGabryJul 21, 2014 02:10 PM 2 122 Jul 21, 2014 02:10 PM
Last Post: MagoGabry