@@ -48,32 +48,20 @@ namespace CSHttpClientSample
48
48
{
49
49
static class Program
50
50
{
51
- // Add your Computer Vision subscription key and endpoint to your environment variables.
51
+ // Add your Computer Vision subscription key and base endpoint to your environment variables.
52
52
static string subscriptionKey = Environment .GetEnvironmentVariable (" COMPUTER_VISION_SUBSCRIPTION_KEY" );
53
-
54
53
static string endpoint = Environment .GetEnvironmentVariable (" COMPUTER_VISION_ENDPOINT" );
55
54
56
- // the GenerateThumbnail method endpoint
57
- static string uriBase = endpoint + " vision/v2.1/generateThumbnail" ;
55
+ // The GenerateThumbnail method endpoint
56
+ static string uriBase = endpoint + " vision/v3.0/generateThumbnail" ;
57
+ // Add an image to your bin/debug/netcoreappX.X folder, then add the image name (with extension), here
58
+ static string imageFilePath = @" my-image-name" ;
58
59
59
- static async Task Main ()
60
+ public static void Main ()
60
61
{
61
- // Get the path and filename to process from the user.
62
- Console .WriteLine (" Thumbnail:" );
63
- Console .Write (
64
- " Enter the path to the image you wish to use to create a thumbnail image: " );
65
- string imageFilePath = Console .ReadLine ();
66
62
67
- if (File .Exists (imageFilePath ))
68
- {
69
- // Call the REST API method.
70
- Console .WriteLine (" \n Wait a moment for the results to appear.\n " );
71
- await MakeThumbNailRequest (imageFilePath );
72
- }
73
- else
74
- {
75
- Console .WriteLine (" \n Invalid file path" );
76
- }
63
+ MakeThumbNailRequest (imageFilePath ).Wait ();
64
+
77
65
Console .WriteLine (" \n Press Enter to exit..." );
78
66
Console .ReadLine ();
79
67
}
0 commit comments