473,569 Members | 2,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Socket programming in asp.net ?

Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is Visual
C#. In page_load event, I am using atl com component. Here one for loop is
there. In this for loop, number of iterations are 1000, I can receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there I need
to create one text file then I want to write this received data into this
text file.
(This is related to users machine. I mean, web pages are accessed from this
machine)

Is there any way to receive data from iis server to users machine like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.
Apr 7 '07 #1
8 4666
re:
ASP.NET supports socket programming like send/receive in c or c++?
Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******** *************** ***********@mic rosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is Visual
C#. In page_load event, I am using atl com component. Here one for loop is
there. In this for loop, number of iterations are 1000, I can receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there I need
to create one text file then I want to write this received data into this
text file.
(This is related to users machine. I mean, web pages are accessed from this
machine)

Is there any way to receive data from iis server to users machine like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.

Apr 7 '07 #2
Hi Juan T. Llibre,

Thank you for your prompt response.

I am new to .NET technologies. Sorry if I am asking very basic questions.

I have one more doubt. For example I deployed one website (www.xyz.com)
in USA. Now, john is the user. He is accessing this web-site from UK. I need
to send some data from USA to UK when user clicked on button. In my web-site
application (code-behind is Visual C#), I can send data using
system.net.soke ts namespace. But, How do I receive that data in UK machine?
Which technology I should use to get the data from USA to UK? ( i mean,
JAVASCRIPT or AJAX or etc....).

Thanks in advance.
--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:
re:
ASP.NET supports socket programming like send/receive in c or c++?

Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******** *************** ***********@mic rosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is Visual
C#. In page_load event, I am using atl com component. Here one for loop is
there. In this for loop, number of iterations are 1000, I can receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there I need
to create one text file then I want to write this received data into this
text file.
(This is related to users machine. I mean, web pages are accessed from this
machine)

Is there any way to receive data from iis server to users machine like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.


Apr 7 '07 #3
re:
How do I receive that data in UK machine?
The user's browser can receive the data via http.

You will need to create a page which receives a query
for data and returns the data to the client as a network stream.

Something like this :

TcpClient tcpc = new TcpClient(serve r, 43);
NetworkStream stream = tcpc.GetStream( );
StreamWriter writer = new StreamWriter(st ream);
StreamReader reader = new StreamReader(st ream);

etc...

re:
Which technology I should use to get the data from USA to UK?
You use C# and the .Net Framework classes to build your ASP.NET page.

re:
JAVASCRIPT or AJAX
You don't need either of them, although you could use Ajax.

Here's a good basic introduction to programming system.net.sock ets in C#:

http://www.developerfusion.co.uk/show/3918/

Read the 4 parts of the article and download/practice with the sample code provided.
When you've done that, socket programming concepts in c# will be clearer.

The example is for a Windows Forms (desktop) program,
but the same classes can be used in an ASP.NET application, using network streams.

Peter Bromberg has a good VB.NET sample at :

http://www.eggheadcafe.com/articles/20020323.asp

This Google search returns many hits with sample code:

http://www.google.com/search?hl=en&q...+%22asp.net%22

Try some of them.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:67******** *************** ***********@mic rosoft.com...
Hi Juan T. Llibre,

Thank you for your prompt response.

I am new to .NET technologies. Sorry if I am asking very basic questions.

I have one more doubt. For example I deployed one website (www.xyz.com)
in USA. Now, john is the user. He is accessing this web-site from UK. I need
to send some data from USA to UK when user clicked on button. In my web-site
application (code-behind is Visual C#), I can send data using
system.net.soke ts namespace. But, How do I receive that data in UK machine?
Which technology I should use to get the data from USA to UK? ( i mean,
JAVASCRIPT or AJAX or etc....).

Thanks in advance.
--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:
>re:
ASP.NET supports socket programming like send/receive in c or c++?

Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
============== =============== ======
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******* *************** ************@mi crosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is Visual
C#. In page_load event, I am using atl com component. Here one for loop is
there. In this for loop, number of iterations are 1000, I can receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there I need
to create one text file then I want to write this received data into this
text file.
(This is related to users machine. I mean, web pages are accessed from this
machine)

Is there any way to receive data from iis server to users machine like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.



Apr 7 '07 #4
ASP.NETsupports socketprogrammi ng like send/receive in c or c++?
Given the disconnected model of HTTP I would avoid hosting sockets
within premises of asp.net worker process.
My requiremnet: I have to send this data to users machine and there I need
to create one text file then I want to write this received data into this
text file.
(This is related to users machine. I mean, web pages are accessed from this
machine)
If the requirements is such that you have to interface this through
ASP.NET I would decouple the socket read write process from the web
application. The service may represent a remoting service or web
service (depending on the nature/size of audience you application
serves). If security is a concern deploy the remoting service over
IIS.
Is there any way to receive data from iis server to users machine likesocketprogr amming in c or c++?
How can I achieve this? What technologies I have to select from VS2005?
However, why do you want to do this through sockets? Are you forced by
design or do you have process on other end sending data packets
through sockets?
If sockets are optional and scalability (& size of data) isn't an
issue I would consider possibilities of streaming data through
HTTPWebRequest. GetRequestStrea m () /
HTTPWebResponse .GetResponseStr eam().

Raaj.
Apr 8 '07 #5
Hi Juan T. Llibre,

Thank you.

.NET 2.0 framework should be there in user's machine if I use
socket programming to receive data in user's machine?

I have experience in VC++ stand-alone applications.

--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:
re:
How do I receive that data in UK machine?

The user's browser can receive the data via http.

You will need to create a page which receives a query
for data and returns the data to the client as a network stream.

Something like this :

TcpClient tcpc = new TcpClient(serve r, 43);
NetworkStream stream = tcpc.GetStream( );
StreamWriter writer = new StreamWriter(st ream);
StreamReader reader = new StreamReader(st ream);

etc...

re:
Which technology I should use to get the data from USA to UK?

You use C# and the .Net Framework classes to build your ASP.NET page.

re:
JAVASCRIPT or AJAX

You don't need either of them, although you could use Ajax.

Here's a good basic introduction to programming system.net.sock ets in C#:

http://www.developerfusion.co.uk/show/3918/

Read the 4 parts of the article and download/practice with the sample code provided.
When you've done that, socket programming concepts in c# will be clearer.

The example is for a Windows Forms (desktop) program,
but the same classes can be used in an ASP.NET application, using network streams.

Peter Bromberg has a good VB.NET sample at :

http://www.eggheadcafe.com/articles/20020323.asp

This Google search returns many hits with sample code:

http://www.google.com/search?hl=en&q...+%22asp.net%22

Try some of them.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:67******** *************** ***********@mic rosoft.com...
Hi Juan T. Llibre,

Thank you for your prompt response.

I am new to .NET technologies. Sorry if I am asking very basic questions.

I have one more doubt. For example I deployed one website (www.xyz.com)
in USA. Now, john is the user. He is accessing this web-site from UK. I need
to send some data from USA to UK when user clicked on button. In my web-site
application (code-behind is Visual C#), I can send data using
system.net.soke ts namespace. But, How do I receive that data in UK machine?
Which technology I should use to get the data from USA to UK? ( i mean,
JAVASCRIPT or AJAX or etc....).

Thanks in advance.
--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:
re:
ASP.NET supports socket programming like send/receive in c or c++?

Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******** *************** ***********@mic rosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is Visual
C#. In page_load event, I am using atl com component. Here one for loop is
there. In this for loop, number of iterations are 1000, I can receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there I need
to create one text file then I want to write this received data into this
text file.
(This is related to users machine. I mean, web pages are accessed from this
machine)

Is there any way to receive data from iis server to users machine like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.


Apr 8 '07 #6
The .Net framework may not necessarily be on the end-user's machine, it's
likely, but not necessarily a guarantee.

Keep in mind that if you're familiar with VC++ stand-alone applications you
can easily use those as well...you dont' have to use the .Net framework.

Your system seems kind of bizarre, though; remember that a web browser is
already a network-based application, why are you building something from the
ground up using sockets?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:10******** *************** ***********@mic rosoft.com...
Hi Juan T. Llibre,

Thank you.

.NET 2.0 framework should be there in user's machine if I use
socket programming to receive data in user's machine?

I have experience in VC++ stand-alone applications.

--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:
>re:
How do I receive that data in UK machine?

The user's browser can receive the data via http.

You will need to create a page which receives a query
for data and returns the data to the client as a network stream.

Something like this :

TcpClient tcpc = new TcpClient(serve r, 43);
NetworkStream stream = tcpc.GetStream( );
StreamWriter writer = new StreamWriter(st ream);
StreamReader reader = new StreamReader(st ream);

etc...

re:
Which technology I should use to get the data from USA to UK?

You use C# and the .Net Framework classes to build your ASP.NET page.

re:
JAVASCRIPT or AJAX

You don't need either of them, although you could use Ajax.

Here's a good basic introduction to programming system.net.sock ets in C#:

http://www.developerfusion.co.uk/show/3918/

Read the 4 parts of the article and download/practice with the sample
code provided.
When you've done that, socket programming concepts in c# will be clearer.

The example is for a Windows Forms (desktop) program,
but the same classes can be used in an ASP.NET application, using network
streams.

Peter Bromberg has a good VB.NET sample at :

http://www.eggheadcafe.com/articles/20020323.asp

This Google search returns many hits with sample code:

http://www.google.com/search?hl=en&q...+%22asp.net%22

Try some of them.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
============== =============== ======
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:67******* *************** ************@mi crosoft.com...
Hi Juan T. Llibre,

Thank you for your prompt response.

I am new to .NET technologies. Sorry if I am asking very basic
questions.

I have one more doubt. For example I deployed one website
(www.xyz.com)
in USA. Now, john is the user. He is accessing this web-site from UK. I
need
to send some data from USA to UK when user clicked on button. In my
web-site
application (code-behind is Visual C#), I can send data using
system.net.soke ts namespace. But, How do I receive that data in UK
machine?
Which technology I should use to get the data from USA to UK? ( i mean,
JAVASCRIPT or AJAX or etc....).

Thanks in advance.
--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:

re:
ASP.NET supports socket programming like send/receive in c or c++?

Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
============== =============== ======
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******* *************** ************@mi crosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is
Visual
C#. In page_load event, I am using atl com component. Here one for
loop is
there. In this for loop, number of iterations are 1000, I can
receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there
I need
to create one text file then I want to write this received data into
this
text file.
(This is related to users machine. I mean, web pages are accessed
from this
machine)

Is there any way to receive data from iis server to users machine
like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from
VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.



Apr 8 '07 #7
Hi Ben Rush,

Thank you. I am new to .net technologies.

Can I create/write a file in the end-user's machine, When the user
requests a page in a web-site?

Let me explain where I stucked. I have atl com dll.It will be there
in IIS Machine. ATL COM DLL can receive some data through socket programming
in for loop of button_click event in aspx page. Here, I want to send this
data from IIS Machine to end-user's machine, then create/write the file with
this data received from IIS server machine. This is my requirement. Is it
possible in asp.net and Visual C#?

If it possible, My doubt is where can I receive this data in
web-application? In visual C++ application, I have two applications which are
client and server applications. We can send data in server using send
function and receive data in client using client function of winsock. but, in
web-based application where I can receive that data like in client
application(VC+ +). Where is client portion of code area to communicate with
server in web-application?

Sorry I ask very basic questions.

Thanks in advance.
--
Thanks & Regards,
John.
"Ben Rush" wrote:
The .Net framework may not necessarily be on the end-user's machine, it's
likely, but not necessarily a guarantee.

Keep in mind that if you're familiar with VC++ stand-alone applications you
can easily use those as well...you dont' have to use the .Net framework.

Your system seems kind of bizarre, though; remember that a web browser is
already a network-based application, why are you building something from the
ground up using sockets?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:10******** *************** ***********@mic rosoft.com...
Hi Juan T. Llibre,

Thank you.

.NET 2.0 framework should be there in user's machine if I use
socket programming to receive data in user's machine?

I have experience in VC++ stand-alone applications.

--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:
re:
How do I receive that data in UK machine?

The user's browser can receive the data via http.

You will need to create a page which receives a query
for data and returns the data to the client as a network stream.

Something like this :

TcpClient tcpc = new TcpClient(serve r, 43);
NetworkStream stream = tcpc.GetStream( );
StreamWriter writer = new StreamWriter(st ream);
StreamReader reader = new StreamReader(st ream);

etc...

re:
Which technology I should use to get the data from USA to UK?

You use C# and the .Net Framework classes to build your ASP.NET page.

re:
JAVASCRIPT or AJAX

You don't need either of them, although you could use Ajax.

Here's a good basic introduction to programming system.net.sock ets in C#:

http://www.developerfusion.co.uk/show/3918/

Read the 4 parts of the article and download/practice with the sample
code provided.
When you've done that, socket programming concepts in c# will be clearer.

The example is for a Windows Forms (desktop) program,
but the same classes can be used in an ASP.NET application, using network
streams.

Peter Bromberg has a good VB.NET sample at :

http://www.eggheadcafe.com/articles/20020323.asp

This Google search returns many hits with sample code:

http://www.google.com/search?hl=en&q...+%22asp.net%22

Try some of them.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:67******** *************** ***********@mic rosoft.com...
Hi Juan T. Llibre,

Thank you for your prompt response.

I am new to .NET technologies. Sorry if I am asking very basic
questions.

I have one more doubt. For example I deployed one website
(www.xyz.com)
in USA. Now, john is the user. He is accessing this web-site from UK. I
need
to send some data from USA to UK when user clicked on button. In my
web-site
application (code-behind is Visual C#), I can send data using
system.net.soke ts namespace. But, How do I receive that data in UK
machine?
Which technology I should use to get the data from USA to UK? ( i mean,
JAVASCRIPT or AJAX or etc....).

Thanks in advance.
--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:

re:
ASP.NET supports socket programming like send/receive in c or c++?

Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******** *************** ***********@mic rosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or c++?

I am developing web-site application in asp.net and code behind is
Visual
C#. In page_load event, I am using atl com component. Here one for
loop is
there. In this for loop, number of iterations are 1000, I can
receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and there
I need
to create one text file then I want to write this received data into
this
text file.
(This is related to users machine. I mean, web pages are accessed
from this
machine)

Is there any way to receive data from iis server to users machine
like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from
VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.



Apr 8 '07 #8
Hi.

Actually your questions are very, very basic - which is okay, but I think
means you may be missing the point on a few very fundamental issues.

It's not the nature of a web browser-based application, typically, to
integrate too tightly with the machine it's running on. This is the case for
many reasons - one of the most important being security - but also because
the general paradigm here is that you can visit a web page from any type of
operating system (Linux, Windows, Mac, etc) and making too many assumptions
about the client itself is often complex. Much care has been taken over the
years to make developing simple web pages (made of HTML and JavaScript) look
and behave the same across platforms; writing a system which is founded upon
much more than that would be even more complicated.

It can be done, though - but it's not ever going to be a steady,
platform-independent solution.

But what it seems like you're after is something very bizarre to me - you're
trying to get the IIS server to initiate contact with a client machine;
which is not something you do very often. IIS is built and secured as a web
server, and your client machines will more than likely be behind NATs,
firewalls, or may not even be turned on - it seems convoluted from my
perspective to expect that a client's machine will always be on and that you
can connect to it. Though clearly possible (that is, connecting to a machine
from a web server using sockets), it's not something I would recommend from
a conceptual or security standpoint.

Why not try something different? If you have the web server parsing and
holding this data - why not have the client machine periodically check in
with the server using a simple web request or web service request, download
the data, and do with it what is necessary? Do you really need things to be
instantaneous? Make the client machines "phone home" periodically.

The web is a very, very disconnected medium; and for security reasons people
have really locked the web down. Creating a reverse connection from the
server to the client is just going to be a real pain in the arse.

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:3E******** *************** ***********@mic rosoft.com...
Hi Ben Rush,

Thank you. I am new to .net technologies.

Can I create/write a file in the end-user's machine, When the user
requests a page in a web-site?

Let me explain where I stucked. I have atl com dll.It will be there
in IIS Machine. ATL COM DLL can receive some data through socket
programming
in for loop of button_click event in aspx page. Here, I want to send this
data from IIS Machine to end-user's machine, then create/write the file
with
this data received from IIS server machine. This is my requirement. Is it
possible in asp.net and Visual C#?

If it possible, My doubt is where can I receive this data in
web-application? In visual C++ application, I have two applications which
are
client and server applications. We can send data in server using send
function and receive data in client using client function of winsock. but,
in
web-based application where I can receive that data like in client
application(VC+ +). Where is client portion of code area to communicate
with
server in web-application?

Sorry I ask very basic questions.

Thanks in advance.
--
Thanks & Regards,
John.
"Ben Rush" wrote:
>The .Net framework may not necessarily be on the end-user's machine, it's
likely, but not necessarily a guarantee.

Keep in mind that if you're familiar with VC++ stand-alone applications
you
can easily use those as well...you dont' have to use the .Net framework.

Your system seems kind of bizarre, though; remember that a web browser is
already a network-based application, why are you building something from
the
ground up using sockets?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:10******* *************** ************@mi crosoft.com...
Hi Juan T. Llibre,

Thank you.

.NET 2.0 framework should be there in user's machine if I use
socket programming to receive data in user's machine?

I have experience in VC++ stand-alone applications.

--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:

re:
How do I receive that data in UK machine?

The user's browser can receive the data via http.

You will need to create a page which receives a query
for data and returns the data to the client as a network stream.

Something like this :

TcpClient tcpc = new TcpClient(serve r, 43);
NetworkStream stream = tcpc.GetStream( );
StreamWriter writer = new StreamWriter(st ream);
StreamReader reader = new StreamReader(st ream);

etc...

re:
Which technology I should use to get the data from USA to UK?

You use C# and the .Net Framework classes to build your ASP.NET page.

re:
JAVASCRIPT or AJAX

You don't need either of them, although you could use Ajax.

Here's a good basic introduction to programming system.net.sock ets in
C#:

http://www.developerfusion.co.uk/show/3918/

Read the 4 parts of the article and download/practice with the sample
code provided.
When you've done that, socket programming concepts in c# will be
clearer.

The example is for a Windows Forms (desktop) program,
but the same classes can be used in an ASP.NET application, using
network
streams.

Peter Bromberg has a good VB.NET sample at :

http://www.eggheadcafe.com/articles/20020323.asp

This Google search returns many hits with sample code:

http://www.google.com/search?hl=en&q...+%22asp.net%22

Try some of them.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
============== =============== ======
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:67******* *************** ************@mi crosoft.com...
Hi Juan T. Llibre,

Thank you for your prompt response.

I am new to .NET technologies. Sorry if I am asking very basic
questions.

I have one more doubt. For example I deployed one website
(www.xyz.com)
in USA. Now, john is the user. He is accessing this web-site from
UK. I
need
to send some data from USA to UK when user clicked on button. In my
web-site
application (code-behind is Visual C#), I can send data using
system.net.soke ts namespace. But, How do I receive that data in UK
machine?
Which technology I should use to get the data from USA to UK? ( i
mean,
JAVASCRIPT or AJAX or etc....).

Thanks in advance.
--
Thanks & Regards,
John.
"Juan T. Llibre" wrote:

re:
ASP.NET supports socket programming like send/receive in c or
c++?

Yes. Use System.Net.Sock ets:

http://quickstarts.asp.net/QuickStar...em.Net.Sockets


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
============== =============== ======
"John" <Jo**@discussio ns.microsoft.co mwrote in message
news:7C******* *************** ************@mi crosoft.com...
Hi all,

I am new to .net technologies.

ASP.NET supports socket programming like send/receive in c or
c++?

I am developing web-site application in asp.net and code behind
is
Visual
C#. In page_load event, I am using atl com component. Here one
for
loop is
there. In this for loop, number of iterations are 1000, I can
receive some
data using com component. It is just set of some characters like
"0123456tyu ".
(This is related to IIS Server machine).

My requiremnet: I have to send this data to users machine and
there
I need
to create one text file then I want to write this received data
into
this
text file.
(This is related to users machine. I mean, web pages are accessed
from this
machine)

Is there any way to receive data from iis server to users machine
like
socket programming in c or c++?

How can I achieve this? What technologies I have to select from
VS2005?

Any suggestions are welcome.

Thanks in advance.

--
Thanks & Regards,
John.




Apr 8 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6330
by: pyguy2 | last post by:
Issues of socket programming can be wierd, so I'm looking for some comments. In my python books I find exclusive use of socket.close(). From my other readings, I know about a "partial close operation". So, I figured it would be useful to post some code about how socket.close() has an implicit send in it and you can actually gain some...
5
3674
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are...
1
3380
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows XP. About the architecture: I have a socket server dll that contains a class that handles connections for a given local ipaddress and port. This...
5
11678
by: mscirri | last post by:
The code below is what I am using to asynchronously get data from a PocketPC device. The data comes in fine in blocks of 1024 bytes but even when I send no data from the PocketPC constant blocks of 1024 with all values set to Null arrive. Other than examine a block of 1024 to see if the entire block is null, is there any other way to determine...
2
15312
by: djc | last post by:
I read a network programming book (based on framework 1.1) which indicated that you should 'never' use the RecieveTimeout or the SendTimeout 'socket options' on TCP sockets or you may loose data. I now see the socket.RecieveTimeout 'property' in the visual studio 2005 help documentation (framework 2.0) and it has example of it being used with...
10
4014
by: Uma - Chellasoft | last post by:
Hai, I am new to VB.Net programming, directly doing socket programming. In C, I will be able to map the message arrived in a socket directly to a structure. Is this possible in VB.Net. Can anyone please help me with some sample codings and guidance? Can you also suggest some other news group available for socket programming in VB.Net?
11
8585
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling mechanisms. I use a non-blocking approach for this, using the call to 'poll' to support the async mechanism - rather than the 'begin' and 'end'...
0
1892
by: shonen | last post by:
I'm currently attempting to connect to a shoutcast server pull down the information from here and then I'll parse it. I got this working with the httplib, which was great, the problem is I want to use the select statement to do only do this periodically. (I'm trying to be a client, accepting data, that might be my first problem) Basically...
3
2759
by: Stuart | last post by:
I am in the process of teaching myself socket programming. I am "playing around" with some simple echo server-client programs for m the book TCP/IP Sockets in C. The Server program is: #include "TCPEchoServer.h" /* TCP echo server includes */ #include <pthread.h /* for POSIX threads */
0
7710
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...
0
7625
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...
0
7935
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7692
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...
0
7992
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...
1
5519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5244
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...
0
3677
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3666
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.