Skip to content

Commit 803006b

Browse files
authored
Updated endpoint
1 parent 0d20f1e commit 803006b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dotnet/ComputerVision/RecognizeText/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeText
1111

1212
public class Program
1313
{
14-
public const string subscriptionKey = "<your training key here>"; //Insert your Cognitive Services subscription key here
15-
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.
16-
14+
public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY");
15+
public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT");
16+
1717
static void Main(string[] args)
1818
{
1919
RecognizeTextSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
@@ -28,8 +28,8 @@ public class RecognizeTextSample
2828
public static async Task RunAsync(string endpoint, string key)
2929
{
3030
Console.WriteLine("Recognizing text from the images:");
31-
32-
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.
31+
// 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.
32+
string imageFilePath = @"Images\handwritten_text.jpg";
3333
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/printed_text.jpg";
3434

3535
await RecognizeTextFromStreamAsync(imageFilePath, endpoint, key, "Handwritten"); //the last parameter is whether the text that has to be extracted is printed or handwritten

0 commit comments

Comments
 (0)