Hai friends....the below code is working well for sending sms from VS2008 C# windows Application...........but i want the same to work in ASP.NET(vb)............can anyone help me....I converted the code and tried but it didnt work..............................................
In the String uri....under send_to put ur mobile Number............... CODING:-(c# windows Application) -
-
using System;
-
using System.Collections.Generic;
-
using System.Linq;
-
using System.Text;
-
using System.Net;
-
using System.IO;
-
namespace internet
-
{
-
class Program
-
{
-
static void Main(string[] args)
-
{
-
String uri = "http://mysmsaddress.net:80/smsc/general/sendsms.jsp
-
?
-
userid=nlarsen&password=sam143wi&submit_name=sam&send_to=919894857426&message_type=0&message_text=Hello";
-
WebRequest req = WebRequest.Create(uri);
-
req.Method = "POST";
-
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(uri);
-
req.ContentLength = bytes.Length;
-
Stream os = req.GetRequestStream();
-
os.Write(bytes, 0, bytes.Length);
-
os.Close();
-
WebResponse res = req.GetResponse();
-
if (res == null)
-
Console.WriteLine("Response Null");
-
StreamReader sr = new StreamReader(res.GetResponseStream());
-
Console.WriteLine("Response :" + sr.ReadLine().ToString());
-
Console.ReadLine();
-
}
-
-
}
-
}
-
-
Converted Code:-(vb)
'The Below Code Should Work For Me.........its not working Now............ -
-
Imports System
-
-
Imports System.Collections.Generic
-
-
Imports System.Linq
-
-
Imports System.Text
-
-
Imports System.Net
-
-
Imports System.IO
-
Shared Sub Main(ByVal args As String())
-
-
Dim uri As String = http://mysmsaddress.net:80
-
/smsc/general/sendsms.jsp?
-
userid=nlarsen&password
-
=sam143wi&submit_name=sam&send_to=919894857426&message
-
_type=0&message_text=Hello Dim req As WebRequest = WebRequest.Create(uri)
-
req.Method = "POST"
-
-
Dim bytes As Byte() = System.Text.Encoding.ASCII.GetBytes(uri)
-
req.ContentLength = bytes.Length
-
-
Dim os As Stream = req.GetRequestStream()
-
os.Write(bytes, 0, bytes.Length)
-
-
os.Close()
-
-
Dim res As WebResponse = req.GetResponse()
-
If res = Nothing Then
-
-
Console.WriteLine("Response Null")
-
-
End If
-
-
Dim sr As New StreamReader(res.GetResponseStream())
-
Console.WriteLine("Response :" + sr.ReadLine().ToString())
-
-
Console.ReadLine()
-
-
End Sub
-
-
pl refer Below. for some clarification/..................... http://www.mysmsaddress.net/SMPP%20AND%20HTTP%20API.pdf
Please Help Me...I need for My Project................
Davidson
2 1100
What is the current output now and what should the output be?
Thank r03..
this program should send sms from computer to Mobile........the windows application was working i.e c#(windows) but the web applcation(Asp.net) is not working,,,,,,,,,,,,,,,,Help me i need the web application should also work.........
ie) Second code I have Send,,,,,,,,,,,,
Davidson..............
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sean Berry |
last post by:
I was writing a little script to test different functions of the time
module. Like an idiot, I named the test script time.py.
Then when I tried to do a "import time" call, I got an error.
So,...
|
by: serge calderara |
last post by:
Dear all,
I have a function that I need to run in a thread due to the fact that it can
takes long time to execute according to the amount of data to collect.
This function is also populating a...
|
by: Christian Christmann |
last post by:
Hi,
in the past I always appreciated your help and hope that you also can help
me this time. I've spent many many hours but still can't solve the
problem by myself and you are my last hope.
...
|
by: stu_gots |
last post by:
I have been losing sleep over this puzzle, and I'm convinced my train
of thought is heading in the wrong direction. It is difficult to
explain my circumstances, so I will present an identical...
|
by: Erik Thorsen |
last post by:
Hello!
I am in the process of creating a database listing tours, something
similar to what you can find on www.infohub.com.
This means that I need to create a database which can be searchable...
|
by: npc |
last post by:
Hello!
- I have a problem, I need to write a
little program a la Mastermind in C (for school). Can anybody help me?
please, contact me by e-mail.
greets
|
by: Dave |
last post by:
I'm struggling with something that should be fairly simple. I just don't
know the regext syntax very well, unfortunately.
I'd like to parse words out of what is basically a boolean search...
|
by: Jintty |
last post by:
Hi,
I'm trying to write a program that will read a txt file, copy it into
another text file and display the number of words, lines and
paragraphs.
I was able to get the copying portion done, but...
|
by: yuanlinjiang |
last post by:
I am working on converting a win32 console application from VC6 to VC7.
My version is Microsoft Development Environment 2003 version 7.1.3088.
The code works fine on VC6. it is a console...
|
by: davy.zou |
last post by:
I have started learning c++ and I need help. I need to write a
program, the question is as follows.
At a post office, there are a certain number of 2, 7, and 9cents
stamps, now, given a total...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
| |