ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.WebClient Error: The underlying connection was closed in Windows Application<p>Hi&nbsp;<a class="username" rel="satabeach">satabeach,</a></p> <p>'Add this three lines of code.</p> <p><strong>C#</strong></p> <pre class="brush: csharp">ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; ServicePointManager.DefaultConnectionLimit = 9999;</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">ServicePointManager.Expect100Continue = True ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType) ServicePointManager.DefaultConnectionLimit = 9999</pre> <p>Refer below modified code.</p> <pre class="brush: vb">Dim SmsStatusMsg As String = String.Empty Try Dim client As WebClient = New WebClient() Dim url As String = &#34;https://rest.nexmo.com/sms/xml?api_key=18c03652&amp;api_secret=7Y3hqMnTF4EuE2HE&amp;from=UCPH&amp;to=9607908122&amp;text=D%c3%a9j%c3%a0+vu&#34; ServicePointManager.Expect100Continue = True ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType) &#39;its same like SecurityProtocolType.Tls12 ServicePointManager.DefaultConnectionLimit = 9999 SmsStatusMsg = client.DownloadString(url) &#39;MessageBox.Show(&#34;Status: &#34; &amp; client.SelectSingleNode(&#34;/response/status/status_msg&#34;).InnerText) Catch ex As Exception Response.Write(ex.Message + &#34; &#34; + ex.StackTrace) End Try</pre>https://www.aspforums.net:443/Threads/209213/WebClient-Error-The-underlying-connection-was-closed-in-Windows-Application/https://www.aspforums.net:443/Threads/209213/WebClient-Error-The-underlying-connection-was-closed-in-Windows-Application/Mon, 29 Oct 2018 00:56:56 GMT