473,805 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help me to solve little problem in ASP.NET

144 New Member
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)
Expand|Select|Wrap|Line Numbers
  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Net;
  7. using System.IO;
  8. namespace internet
  9. {
  10.     class Program
  11.     {
  12.        static void Main(string[] args)
  13.         {
  14.             String uri = "http://mysmsaddress.net:80/smsc/general/sendsms.jsp
  15. ?
  16. userid=nlarsen&password=sam143wi&submit_name=sam&send_to=919894857426&message_type=0&message_text=Hello";
  17.             WebRequest req = WebRequest.Create(uri);
  18.             req.Method = "POST";
  19.             byte[] bytes = System.Text.Encoding.ASCII.GetBytes(uri);
  20.             req.ContentLength = bytes.Length;
  21.             Stream os = req.GetRequestStream();
  22.             os.Write(bytes, 0, bytes.Length);
  23.             os.Close();
  24.             WebResponse res = req.GetResponse();
  25.             if (res == null)
  26.                 Console.WriteLine("Response Null");
  27.             StreamReader sr = new StreamReader(res.GetResponseStream());
  28.             Console.WriteLine("Response :" + sr.ReadLine().ToString());
  29.             Console.ReadLine();
  30.         }
  31.  
  32.     }
  33. }
  34.  
  35.  
Converted Code:-(vb)
'The Below Code Should Work For Me.........its not working Now............
Expand|Select|Wrap|Line Numbers
  1.  
  2. Imports System
  3.  
  4. Imports System.Collections.Generic
  5.  
  6. Imports System.Linq
  7.  
  8. Imports System.Text
  9.  
  10. Imports System.Net
  11.  
  12. Imports System.IO 
  13. Shared Sub Main(ByVal args As String())
  14.  
  15. Dim uri As String = http://mysmsaddress.net:80
  16. /smsc/general/sendsms.jsp?
  17. userid=nlarsen&password
  18. =sam143wi&submit_name=sam&send_to=919894857426&message
  19. _type=0&message_text=Hello Dim req As WebRequest = WebRequest.Create(uri) 
  20. req.Method = "POST"
  21.  
  22. Dim bytes As Byte() = System.Text.Encoding.ASCII.GetBytes(uri) 
  23. req.ContentLength = bytes.Length
  24.  
  25. Dim os As Stream = req.GetRequestStream() 
  26. os.Write(bytes, 0, bytes.Length)
  27.  
  28. os.Close()
  29.  
  30. Dim res As WebResponse = req.GetResponse() 
  31. If res = Nothing Then
  32.  
  33. Console.WriteLine("Response Null")
  34.  
  35. End If
  36.  
  37. Dim sr As New StreamReader(res.GetResponseStream()) 
  38. Console.WriteLine("Response :" + sr.ReadLine().ToString())
  39.  
  40. Console.ReadLine()
  41.  
  42. End Sub
  43.  
  44.  

pl refer Below. for some clarification/............... ......

http://www.mysmsaddress.net/SMPP%20AND%20HTTP%20API.pdf



Please Help Me...I need for My Project........ ........

Davidson
Apr 1 '08 #1
2 1127
r035198x
13,262 MVP
What is the current output now and what should the output be?
Apr 1 '08 #2
davidson1
144 New Member
Thank r03..

this program should send sms from computer to Mobile........t he 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....... .......
Apr 1 '08 #3

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

Similar topics

2
1324
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, my time.py has overwritten the time.py builtin mod. I have python 2.3 installed on a few different servers, so I was going to copy over the .py file in /usr/local/lib/python2.3, but I could not find one... not even on the servers where I didn't...
12
1554
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 treeview control whne collected data gets finished. In order to achieve this I have used the following code : System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf GetListOfReelsFromRemoteDB))
7
1816
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. I've a program which is using self-written double-linked lists as a data structure. The template list consists of list elements and the list itself linking the list elements.
28
3308
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 make-believe challenge in order to avoid confusing the issue further. Suppose I was hosting a dinner and I wanted to invite exactly 12 guests from my neighborhood. I'm really picky about that... I have 12 chairs besides my own, and I want them all...
3
1453
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 with destination, category, price and so forth. Unfortunately I can not seem to be able to create the relationships, neither can I make my head learn how to do this. I would be extremely happy if anyone could help me solve this problem for me or...
38
2680
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
6
4804
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 string. It's actually the input string into a Microsoft Index Server search. The string will consist of words, perhaps enclosed in quotes or parentheses. I'd like to use Regex to pull out the words, or the phrases if the words are enclosed in quotes....
5
1772
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 i'm struggling with the counters. processBlank is supposed to increment the number of words whenever it hits a nonblank, so i figured using if its not equal to blank then update word count but no luck please help me, i'd appreciate any help
7
6957
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 program for scientific computation, so it has nothing to do with MFC. But it needs some other libraries such as MKL, sparselib, etc. VC7 can build the executable successfully. However, when i run it, there is only one line on the command window:
45
4309
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 number of cents required, find the correct and most effective combination of stamps. meaning that if you were to need 14cents, the correct output should be 2 seven cents not 7 two cents.
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10366
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10105
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.