Confused between Web Application and Web Forms

2019-07-13 07:38发布

问题:

I just purchased a Twilio account and an 888 business number, and am now working to setup a very simple call system for my business. Everything from the examples is working fine, however I wish to create a C# Web Forms Application that I will run as the server. There C# based examples seem to be centered around ASP.NET Web Applications though, which I know basically nothing about.

Can a C# ASP.NET application be a self serving (standalone) .exe, or is there any way I can make a C# Windows Form Application work with this instead?

If needed, this is the tutorial I am following and need to implement... http://www.twilio.com/docs/howto/ivrs-the-basics

回答1:

Web applications are web sites run from IIS. You can't "execute" a web application as an EXE. A Windows Forms application, on the other hand, is a Windows application that runs on a user's desktop.

Choosing one or the other depends on your particular needs.



回答2:

When Twilio receives a call on your behalf it sends a notification about this event to your application. In your Twilio account settings you specify where this notification is to be sent to.

Whatever address (URL) you specify there - your application should be listening to the commands sent to this address. You can do this in a number of ways, including "Standalone .exe", but the easiest way to do it is to set up a web application.

If you are building an IVR your web application should respond to the request with the web page consisting of the TwiML as explained in the tutorial.

BTW I would not use WebForms for the Web App WebForm isert too much HTML in the responses. Go with ASP.NET MVC. It will be easier because in your case the response has nothing to do with HTML

Also debugging this app should be pretty stright forward - you just type your app url in your browser and look at the output in the browser.



回答3:

I don't really understand your question but... most Twilio features require that your code is running on a webserver that their webserver can send requests to. A standalone .exe isn't going to do that. ASP.NET Web Forms would (though only when run from a server that Twilio's server can reach).



回答4:

You can use the built in development webserver that is shipped with visual studio, you could easily deploy this to a client machine with VS, this can host a website but is very limited and not sure about licence implications

see http://msdn.microsoft.com/en-us/magazine/cc188791.aspx