|
i m developing web application in which i m sending and receiving sms through mobile connected with a cable. but sms is not receiving.
|
|
|
|
|
You've asked this three times now. You need to talk to the people who provide you with an API for SMS sending/recieving. I don't really see how you can connect to a mobile with a cable, and then run it as a web app, given as your code will run on the server, and the phone will be on the client end.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
my dear you want to recive sms through internet so u can use some protocoles
like
http,shttp,or smpp
in http you can connect to the smsc (mobile company)and they send to u they message in query string and from your side you can catch them by httplistner
and her is some code to help u
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
///
/// Summary description for HttpServer
///
public class HttpServer
{
/*
HttpListener This class cannot be inherited.
Note: This class is new in the .NET Framework version 2.0.
we can find it in Namespace: System.Net
An HttpListener can require client authentication.
You can either specify a particular scheme to use for authentication
or you can specify a delegate that determines the scheme to use.
You must require some form of authentication to obtain information about the client's identity.
*/
private HttpListener Listener;
public HttpServer()
{
// Define Listner in constractor to give it the default value
Listener = new HttpListener();
// Prefixes take the host which handling all requests or the target machine which recive all requests
// prefix take string including url,ip,*,+ and port no.and it must closed with / as u see in the code
Listener.Prefixes.Add("http://127.0.0.1:9400/");
// opening the listener to begin listen
Listener.Start();
/*
* senario "synchronous model"
* ---------*********---------
The synchronous model is appropriate if your application should block while waiting for a client request
and if you want to process only one request at a time.
Using the synchronous model
call the ***GetContext method***
which waits for a client to send a request.
The method returns an HttpListenerContext object to you for processing when one occurs.
---------C0de......
*wait for incoming request and returns when one is recived
Listener.GetContext();
HttpListenerContext context = Listener.GetContext();
HttpListenerRequest request = context.Request;
// Obtain a response object.
HttpListenerResponse response = context.Response;
// Construct a response.
string responseString = " Hello world!";
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
// Get a response stream and write the response to it.
response.ContentLength64 = buffer.Length;
System.IO.Stream output = response.OutputStream;
output.Write(buffer,0,buffer.Length);
// You must close the output stream.
output.Close();
Listener.Stop();
***************************************************************************************
***************************************************************************************
* in this code senario "asynchronous model"
* ----------------***********---------------
In the more complex asynchronous model, your application does not block while
waiting for requests and each request is processed in its own execution thread.
Use the*** BeginGetContext***
method to specify an application-defined method to be called for each incoming request.
Within that method
call the EndGetContext method to obtain the request, process it, and respond.
*/
//For Example we have 20 servers
for (int x = 0; x < 20; x++)
{
Listener.BeginGetContext(new AsyncCallback(ListenerCallback),this.Listener);
}
}
protected void ListenerCallback(IAsyncResult result)
{
if (this.Listener == null) return;
//HttpListenerContext Provides access to the request and response objects used by the HttpListener class.
HttpListenerContext context = this.Listener.EndGetContext(result);
//We setup a new context for the next request
this.Listener.BeginGetContext(new AsyncCallback(ListenerCallback),this.Listener);
this.ProcessRequest(context);
context.Response.Close();
}
//Overridable method that can be used to implement a custom handler
protected virtual void ProcessRequest(HttpListenerContext context)
{
string Sender = context.Request.QueryString["sender"];
string Receiver = context.Request.QueryString["receiver"];
string Msg = context.Request.QueryString["msg"];
byte[] buffer =
System.Text.Encoding.UTF8.GetBytes("{SMS:TEXT}{}{+36205555224}{+36201111245}{Thank you for the answer}" + System.Environment.NewLine);
context.Response.OutputStream.Write(buffer, 0, buffer.Length);
}
}
------------------------------------
i hope it will be usefull
Kareem Elhosseny
|
|
|
|
|
can anyone send me the model qestions and answer for 70-315 (Developing and Implementing Web Applications with MicrosoftVisual C#). thanks in advance
|
|
|
|
|
See, it's because of people like you that certifications are worthless. Just say I had these answers and sent them to you. Do you think you can go into an interview with that certificate, but have no idea how to pass the test ( i.e. not know how to write web apps with C# ) and get a job ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have a problem with browser back button in my website on production server. I have done lot of googling but cannot find the solution. However browser back button work correctly on local server.
I am using asp.net 1.1 / C#, Window 2003 server and also me website using ssl.
In some pages browser back button works correctly, but in some page it gives the following error.
"The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
To resubmit your information and view this Web page, click the Refresh button. "
Any Help would be highly appreciated.
With Regards,
Umair Hasan Zubairy,
Software Engineer.
Good Luck
|
|
|
|
|
This means you did a postback. The way around this is to redirect on a postback and put the data your form needs to maintain it's state, on the URL.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Thanks for your quick response. Actually I am not doing a POSTBACK. I am just clicking the browser back button, so that browser get the page from cache and display it. But it shows that the page has expired.
It works correctly on local server where we have not incorporte ssl certificate. But it shows poblem on server where we have incorporate ssl certificate.
Again thanks for you reply ..
With Regards,
Umair Hasan Zubairy,
Software Engineer.
Good Luck
|
|
|
|
|
OK, then it's an issue when SSL is on. You didn't say that before.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have mentioned that i am using ssl in my first post, but however i apologize if i am not so clear. Can you tell me the solution that how can i prevent this page expiration.
Thanks,
Umair Hasan Zubairy,
Software Engineer.
|
|
|
|
|
Hello guys,
I want to update my Access database. I can update all fields of the table except password field.
If i omit password field from the QuerryString, remaining fields are successfully updating. E.g.
QuerryString = "update Users set name=@name,emailid=@emailid,dob=@dob,address1=@address1,address2=@address2,city=@city,state=@state,pincode=@pincode,country=@country,accounttype=@accounttype,boss=@boss where username='ABC'";
This is successful.
But when i add password field to it, its showing syntax error in update stmt. e.g.
QuerryString="update Users set password=@password,name=@name,emailid=@emailid,dob=@dob,address1=@address1,address2=@address2,city=@city,state=@state,pincode=@pincode,country=@country,accounttype=@accounttype,boss=@boss where username='ABC'";
This is showing error:"Syntax Error in Update Stmt."
Can anyone help me?
Thanks,
Nagendra.
|
|
|
|
|
Do you add the password parameter ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, Ofcourse i added that.
|
|
|
|
|
well, if you don't post the code...
what if you run the same code within your database itself ? Obviously inserting values, does it work ?
If password is a reserved word ( I don't think it is ), putting it in [] will work, for SQL Server at least.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi there,
I don't really know whether password is a reserve word or not but i renamed it to pwd and it worked.
Thnx,
Nagendra.
|
|
|
|
|
nagendrathecoder wrote: password=@password
password might be a reserved word. Try renaming this column
|
|
|
|
|
Hey Navneeth,
Thnx man, ur suggestion worked.
I changed password to pwd and it updates successfully.
Thnx again.
Nagendra.
|
|
|
|
|
or he can put it in [] like [password]
|
|
|
|
|
hi
i have some categories but i like to only save their ID in my database
i'd like to know where should i save their names and IDs? in xml file? dataset? or what?
and how can i call their name by their ID?
thank you so much
|
|
|
|
|
Your database should have a seperate table that maps Ids to names.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
you are right!!
thank you
modified 27-Jun-17 6:05am.
|
|
|
|
|
Here is another question
i have a TreeView in my page and i have a table in my database that has these columns: RecordID, CategoryID, CategoryName, Parent ID
how i can bind categories to this treeview that it first show parents then their childs?
thank you
|
|
|
|
|
Farhad Eft wrote: only save their ID in my database
Alternate you can store ID and Value in an XML file if it is a fixed number of Items and the number of items are not going to change often. Reading from the XML file will be bit faster than Querying against the Database.
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
thank you jon
but how can i show them in treeview?
that it shows parent categories first then their childs
|
|
|
|
|
hi
i'd like to know how can i add a counter to reapeater control's rows
like this:
1. user1
2. user2
3. user3
...
thank you
|
|
|
|