Click here to Skip to main content
15,885,767 members
Home / Discussions / C#
   

C#

 
Questionhow can i resize my picturebox image with less pixels? Pin
megha_p22-May-14 22:00
megha_p22-May-14 22:00 
AnswerRe: how can i resize my picturebox image with less pixels? Pin
OriginalGriff22-May-14 22:14
mveOriginalGriff22-May-14 22:14 
AnswerRe: how can i resize my picturebox image with less pixels? Pin
Karen Mitchelle22-May-14 22:21
professionalKaren Mitchelle22-May-14 22:21 
GeneralRe: how can i resize my picturebox image with less pixels? Pin
Pete O'Hanlon22-May-14 22:39
mvePete O'Hanlon22-May-14 22:39 
GeneralRe: how can i resize my picturebox image with less pixels? Pin
Karen Mitchelle22-May-14 23:02
professionalKaren Mitchelle22-May-14 23:02 
GeneralRe: how can i resize my picturebox image with less pixels? Pin
Pete O'Hanlon22-May-14 23:41
mvePete O'Hanlon22-May-14 23:41 
AnswerRe: how can i resize my picturebox image with less pixels? Pin
Emre Ataseven25-May-14 10:08
professionalEmre Ataseven25-May-14 10:08 
QuestionError in Console App:"The request was aborted: Could not create SSL/TLS secure channel." Pin
QuickDeveloper22-May-14 9:05
QuickDeveloper22-May-14 9:05 
Hi All

I am calling a REST API from my C# Console application and get the following error while calling GetResponse method
"The request was aborted: Could not create SSL/TLS secure channel."

The code has worked before couple of days back , so I am not sure what changed. The cert I am using is valid cert installed on my machine where I run the code, I checked the expiration details and all.

My code is as follows, it fails in the try block below.The uri that I pass is this -https://management.core.windows.net/{0}/services/hostedservices[^] I replace the {0} with a valid id ofcourse.

Code:
C#
public static XDocument GetResponse(Uri uri)
        {
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
            request.Method = "GET";
            request.Headers.Add("x-ms-version", msVersion);
            request.ClientCertificates.Add(certificate);
            request.ContentType = "application/xml";
            

            XDocument responseBody = null;
            HttpWebResponse response;

            try
            {
                response = (HttpWebResponse)request.GetResponse();
            }
         catch (WebException ex)
     {
         response = (HttpWebResponse)ex.Response;
     }
}

Exception:
The complete exception is:
System.Net.WebException was caught
HResult=-2146233079
Message=The request was aborted: Could not create SSL/TLS secure channel.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at StorageAccountsExtractor.AzureService.GetResponse(Uri uri) in e:\StorageAccountsRetriever\StorageAccountsExtractor\StorageAccountsExtractor\Program.cs:line 289
InnerException:

Solution:
I looked on the web and looks like I need to make HTTPS use TLS? how do I do that.Any other ideas that I could look into?
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"


AnswerRe: Error in Console App:"The request was aborted: Could not create SSL/TLS secure channel." Pin
BobJanova22-May-14 22:58
BobJanova22-May-14 22:58 
QuestionHow to send 255 bit data to I/O card ? Pin
Erkanh22-May-14 9:04
Erkanh22-May-14 9:04 
AnswerRe: How to send 255 bit data to I/O card ? Pin
jschell22-May-14 9:16
jschell22-May-14 9:16 
AnswerRe: How to send 255 bit data to I/O card ? Pin
OriginalGriff22-May-14 22:17
mveOriginalGriff22-May-14 22:17 
AnswerRe: How to send 255 bit data to I/O card ? Pin
Rob Philpott22-May-14 22:22
Rob Philpott22-May-14 22:22 
GeneralIs it possible controlling number of 255 solenoid valve ? Pin
Erkanh16-Jun-14 2:23
Erkanh16-Jun-14 2:23 
QuestionHow do I find the field in which the match has been found? Pin
Shubhanshu Pathak22-May-14 8:12
Shubhanshu Pathak22-May-14 8:12 
AnswerRe: How do I find the field in which the match has been found? Pin
OriginalGriff22-May-14 8:27
mveOriginalGriff22-May-14 8:27 
AnswerRe: How do I find the field in which the match has been found? Pin
Shubhanshu Pathak22-May-14 18:19
Shubhanshu Pathak22-May-14 18:19 
GeneralRe: How do I find the field in which the match has been found? Pin
Richard MacCutchan22-May-14 21:04
mveRichard MacCutchan22-May-14 21:04 
QuestionHow to read data from Staff ID Card using c# Pin
Member 1050484922-May-14 3:46
Member 1050484922-May-14 3:46 
AnswerRe: How to read data from Staff ID Card using c# Pin
Richard MacCutchan22-May-14 3:54
mveRichard MacCutchan22-May-14 3:54 
QuestionShare an event between two forms. Pin
jenya722-May-14 2:18
jenya722-May-14 2:18 
AnswerRe: Share an event between two forms. Pin
joost.versteegen22-May-14 3:36
joost.versteegen22-May-14 3:36 
GeneralRe: Share an event between two forms. Pin
jenya722-May-14 4:12
jenya722-May-14 4:12 
GeneralRe: Share an event between two forms. Pin
jenya722-May-14 4:15
jenya722-May-14 4:15 
GeneralRe: Share an event between two forms. Pin
jenya722-May-14 4:53
jenya722-May-14 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.