For example System.Net.HttpStatusCode Enum , i would like to get the HTTP Status Codes instead of the HTTP Status Text System.Net.HttpStatusCode.Forbidden should return 403 instead of "Forbidden"
how can i extract the value?
For example System.Net.HttpStatusCode Enum , i would like to get the HTTP Status Codes instead of the HTTP Status Text System.Net.HttpStatusCode.Forbidden should return 403 instead of "Forbidden"
how can i extract the value?
For the majority of Enum's simply cast to the base type which is int32.
int value = (int)System.Net.HttpStatusCode.Forbidden;
You can just cast it to an integer! So, int code = (int)enumVariable
System.Convert.ToInt32(response.StatusCode) returns the statusCode number