diff --git a/dotnet/ComputerVision/RecognizeText/Program.cs b/dotnet/ComputerVision/RecognizeText/Program.cs index 3d19ab8..4473d9e 100644 --- a/dotnet/ComputerVision/RecognizeText/Program.cs +++ b/dotnet/ComputerVision/RecognizeText/Program.cs @@ -11,9 +11,9 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeText public class Program { - public const string subscriptionKey = ""; //Insert your Cognitive Services subscription key here - public const string endpoint = "https://westus.api.cognitive.microsoft.com"; // You must use the same Azure region that you generated your subscription keys for. Free trial subscription keys are generated in the westus region. - + public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY"); + public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT"); + static void Main(string[] args) { RecognizeTextSample.RunAsync(endpoint, subscriptionKey).Wait(5000); @@ -28,8 +28,8 @@ public class RecognizeTextSample public static async Task RunAsync(string endpoint, string key) { Console.WriteLine("Recognizing text from the images:"); - - string imageFilePath = @"Images\handwritten_text.jpg"; // See this repo's readme.md for info on how to get these images. Alternatively, you can just set the path to any appropriate image on your machine. + // See this repo's readme.md for info on how to get these images. Or, set the path to any appropriate image on your machine. + string imageFilePath = @"Images\handwritten_text.jpg"; string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/printed_text.jpg"; await RecognizeTextFromStreamAsync(imageFilePath, endpoint, key, "Handwritten"); //the last parameter is whether the text that has to be extracted is printed or handwritten