473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 4649
re:
ASP.NET supports socket programming like send/receive in c or c++?
Yes. Use System.Net.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microsof t.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.sokets 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.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microsof t.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(server, 43);
NetworkStream stream = tcpc.GetStream();
StreamWriter writer = new StreamWriter(stream);
StreamReader reader = new StreamReader(stream);

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.sockets 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**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.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.sokets 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.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microso ft.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.NETsupportssocketprogramming 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 likesocketprogramming 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.GetRequestStream () /
HTTPWebResponse.GetResponseStream().

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(server, 43);
NetworkStream stream = tcpc.GetStream();
StreamWriter writer = new StreamWriter(stream);
StreamReader reader = new StreamReader(stream);

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.sockets 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**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.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.sokets 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.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microsof t.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**@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.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(server, 43);
NetworkStream stream = tcpc.GetStream();
StreamWriter writer = new StreamWriter(stream);
StreamReader reader = new StreamReader(stream);

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.sockets 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**@discussions.microsoft.comwrote in message
news:67**********************************@microso ft.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.sokets 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.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microso ft.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**@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.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(server, 43);
NetworkStream stream = tcpc.GetStream();
StreamWriter writer = new StreamWriter(stream);
StreamReader reader = new StreamReader(stream);

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.sockets 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**@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.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.sokets 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.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microsof t.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**@discussions.microsoft.comwrote in message
news:3E**********************************@microsof t.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**@discussions.microsoft.comwrote in message
news:10**********************************@microso ft.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(server, 43);
NetworkStream stream = tcpc.GetStream();
StreamWriter writer = new StreamWriter(stream);
StreamReader reader = new StreamReader(stream);

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.sockets 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**@discussions.microsoft.comwrote in message
news:67**********************************@microso ft.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.sokets 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.Sockets:

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**@discussions.microsoft.comwrote in message
news:7C**********************************@microso ft.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
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...
5
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...
1
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...
5
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...
2
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...
10
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...
11
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...
0
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...
3
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: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.