473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

The underlying connection was closed: The remote name could not be resolved.

144 100+
Hai in my Project how to send sms from computer to mobile ....

Front-End :- ASP.NET(vb)



I am using the following code, but it shows me a ERROR

"The underlying connection was closed: The remote name could not be resolved. "

You can check by putting Ur mobile number....wheather you get sms or not

gateway is correct one

I have checked this in net and did some modification in machine.config and web.config, But it is still not working

if anybody know pl reply to me........

Thanks in advance..............



Imports System.Text
Imports System.Net
Imports System.IO
Imports System.Collections.Specialized
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Web
Imports System.Web.SessionState

Dim strUrl, strUser, strPass, strFrom, strTo, strText As String

strUrl = "http://mysmsadress.net:80/smsc/general/sendsms.jsp?userid=nlarsen&password=sam143wi&submi t_name=david&send_to=9486309490&message_type=0&mes sage_text=hu"

strUser = "nlarsen"
strPass = "sam143wi"
strFrom = "Hai"
strTo = "9486309490"
strText = "Hello"


Dim values As New System.Collections.Specialized.NameValueCollection
values.Add("user", strUser)
values.Add("pass", strPass)
values.Add("from", strFrom)
values.Add("to", strTo)
values.Add("text", strText)

Dim postData As String = String.Empty
For i As Integer = 0 To values.Keys.Count - 1
If i > 0 Then
postData &= "&"
End If
postData &= values.Keys(i) & "=" & values(values.Keys(i))
Next

Dim request As System.Net.HttpWebRequest
request = System.Net.HttpWebRequest.Create(strUrl)
request.Method = "POST"
request.ContentType = "application/x-www-form-urlencoded"

Dim stream As IO.Stream = request.GetRequestStream
Dim bytes As Byte() = System.Text.Encoding.UTF8.GetBytes(postData)
stream.Write(bytes, 0, bytes.Length)
stream.Close()

Dim response As System.Net.HttpWebResponse
response = request.GetResponse

Dim sr As IO.StreamReader = New IO.StreamReader (response.GetResponseStream)
Dim result As String = sr.ReadToEnd
sr.Close()

Posted Date: - 19 Feb 2008

Davidson.....
Feb 19 '08 #1
0 977

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ashima | last post by:
Hi, I am trying to add a webservice.I provide a reference to the wsdl file on the server. It works fine when I compile the code on my machine. But on the server, I get the above error with the same...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
3
by: MattM | last post by:
I am getting the "The underlying connection was closed: Unable to connect to the remote server" message when trying to connect an ASPX page to a simple Hello World web service. I have read a few...
2
by: niklesh | last post by:
Dear all, when i am trying to giving web reference to webservices i am getting above said error.. i tried to find out what is the main problem then i got from microsoft support that i have to...
2
by: hazz | last post by:
Dim ws As New GetInfoByZIP.USZip works great if I have an internet connection on my dev machine. As soon as I lose or disable my internet connection I get "The underlying connection was...
0
by: marina.sukhnev | last post by:
Hi guys, I have some issue. Recently we moved our servers to different location and ip addressed have changed,now we started to use dsn everywhere. I have an existing web service that uploads...
3
by: Rahul Anand | last post by:
As per our requirements we have a web service which internally connects (Simple HTTP Post Request) to a remote server to initiate some work. We are calling the web service method asynchronously...
0
by: RichardH | last post by:
I have a win32 .net app that uses a webservice to access a databse. AOL clients, using dial-up, receive the the exception "The underlying connection was closed. The remote name could not be...
3
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net...
0
by: Harrison2 | last post by:
Hello! I have following problem. I write a self-updating application using Microsoft Application Blocks (Updater). And if I run it on Win XP, I have following error: The underlying...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.