Call both methods in main function,it is look like this static void Main(string[] args) { // Set Sample Image Path String ImagePath = AppDomain.CurrentDomain.BaseDirectory + "SampleImage.jpg"; ReadTextFromImage(ImagePath); // Set Store Image Content text file Path String StoreTextFilePath = AppDomain.CurrentDomain.BaseDirectory + "SampleText.txt"; ReadTextFromImage(ImagePath, StoreTextFilePath); }