473,508 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connect to internet from a windows service

Hello,

I'm creating a windows service with VB.net. (vs 2003)
I want this service to connect (or check the status of the connection) to
the internet via a ISDN modem connection (standard dailup) without a logged
in user.
The service is running on a windows XP embedded OS.

Can anyone point me in the right direction with this, I have no idea where
to start on this on

Thanks in for your reply

Regards, @win
Aug 25 '05 #1
6 2342
Win,

In my idea simple, with a modem connection you should have a provider who
handles your connection and therefore you should have a user and a password.

I hope this helps,

Cor,
Aug 26 '05 #2
Hi Cor, Thanks for your response.

This is not really the problem. Let say the dailup connection was already
configured and ready to connect. What I want to do now is to let the windows
service (no logged in user) connect to the internet (at boot, or when
connection was lost)

The machine is running in an remote location and does not have a user
(headless system). I need this system to dump some data every 15 minutes to a
webservice.
Before it can do that it needs a connection via the ISDN line. therfore i
need to setup a routine that prior to dumping the data checks the status of
the connection, and if lost reestablishes it.

Thanks for your help
--
Regards, @win
"Cor Ligthert [MVP]" wrote:
Win,

In my idea simple, with a modem connection you should have a provider who
handles your connection and therefore you should have a user and a password.

I hope this helps,

Cor,

Aug 26 '05 #3
Win,

Sorry, I was talking from a webservice. What you want to do is a simple ping
to an external server. And for that I know only a commandline solution which
you cannot use.

Can you maybe do something with this one. It is a sample how to get the page
from Google, however what you get is of course not important.

Using this class you can as well get server information. However this is a
very nice short sample.

\\\
Module main
Public Sub main()
Dim myReg As Net.HttpWebRequest = _
DirectCast(Net.WebRequest.Create("http://www.google.com"), _
Net.HttpWebRequest)
Dim myResp As Net.HttpWebResponse = _
DirectCast(myReg.GetResponse(), Net.HttpWebResponse)
Dim myStream As IO.Stream = myResp.GetResponseStream()
Dim myreader As New IO.StreamReader(myStream)
Dim mystring As String = myreader.ReadToEnd()
myResp.Close()
End Sub
End Module
///

I hope this helps a little bit?

Cor
Aug 26 '05 #4
Hi Cor, thanks again for your response

Yes I could do that but determining the status of the connection is not the
only thing that I need to do. Also If I use your approach or an Exeption
handler (when trying to connect to the webservice) than that does not realy
say anything about the status of the connection , A server on the internet
could be down and I still could be connected to the internet.

With the status of the connection I need to determine if I have to reconnect
to the internet throught a dailup connection yes or no.

For me the real challenge is to get a dailup connection profile to reconnect
to the internet from my code (windows service, no logged in user). I have
found out that you can use the RAS API and PInvoke to do that, but this is
all in C++, not really my cup of tea.

I hope you understand my problem and that you have any other Ideas, Thanks
again for your thoughts,

--
Regards, @win
"Cor Ligthert [MVP]" wrote:
Win,

Sorry, I was talking from a webservice. What you want to do is a simple ping
to an external server. And for that I know only a commandline solution which
you cannot use.

Can you maybe do something with this one. It is a sample how to get the page
from Google, however what you get is of course not important.

Using this class you can as well get server information. However this is a
very nice short sample.

\\\
Module main
Public Sub main()
Dim myReg As Net.HttpWebRequest = _
DirectCast(Net.WebRequest.Create("http://www.google.com"), _
Net.HttpWebRequest)
Dim myResp As Net.HttpWebResponse = _
DirectCast(myReg.GetResponse(), Net.HttpWebResponse)
Dim myStream As IO.Stream = myResp.GetResponseStream()
Dim myreader As New IO.StreamReader(myStream)
Dim mystring As String = myreader.ReadToEnd()
myResp.Close()
End Sub
End Module
///

I hope this helps a little bit?

Cor

Aug 28 '05 #5
hB
WinINet dial-up functions
InternetAutodial
InternetAutodialHangup
InternetDial
InternetGetConnectedState
InternetHangUp
InternetGoOnline

VisualBasic
http://www.vbip.com/wininet/wininet_connection_01.asp
http://www.vbip.com/wininet/wininet_dialup.asp

simple sample c#
http://www.aspemporium.com/howto.aspx?hid=34

RAS Library in Dotnet
http://www.gotdotnet.com/Workspaces/...3-e5fdb0895b8e

---
hB

Sep 5 '05 #6
Thanks hb,

This is what i need.
--
Regards, @win
"hB" wrote:
WinINet dial-up functions
InternetAutodial
InternetAutodialHangup
InternetDial
InternetGetConnectedState
InternetHangUp
InternetGoOnline

VisualBasic
http://www.vbip.com/wininet/wininet_connection_01.asp
http://www.vbip.com/wininet/wininet_dialup.asp

simple sample c#
http://www.aspemporium.com/howto.aspx?hid=34

RAS Library in Dotnet
http://www.gotdotnet.com/Workspaces/...3-e5fdb0895b8e

---
hB

Sep 7 '05 #7

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

Similar topics

0
2923
by: Jim | last post by:
I'm working on my first .net project using c#. I've been using activex controls embedded in a web page and wanted to do the same in ..net. My approach has been to create a windows control library...
5
5662
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
3
7564
by: hkappleorange | last post by:
I connect to mdb file using the following codes. How should I modify it if I want to connect to Excel instead ? <%@ Import Namespace="System.Data.OleDb" %> <% Dim conAuthors As...
6
460
by: @win | last post by:
Hello, I'm creating a windows service with VB.net. (vs 2003) I want this service to connect (or check the status of the connection) to the internet via a ISDN modem connection (standard dailup)...
0
331
by: Moe | last post by:
It seems that some recent Microsoft Windows 2000 Service Pack updates has caused the configuration export function in IBM DB2 connect Ver. 7.2 to malfunction by exporting a blank file. The...
3
11737
by: David++ | last post by:
Hi folks, I have built a VS2005 project which includes a C# Web Service, C# Windows Forms app (which uses the Web Service), and a C# PocketPC app (which also uses the web service). When I run...
0
1984
by: =?Utf-8?B?TWlrZTEz?= | last post by:
Sorry for the cross post from dontnet.framework but I'm hoping this may see more activity here. I have written an application to access a web service. The application runs at multiple sites and...
0
2370
by: =?Utf-8?B?TWlrZTEz?= | last post by:
Sorry for the cross post; I'm hoping this will get a response here... I have written an application to access a web service. The application runs at multiple sites and must cross a proxy server....
3
2896
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
0
7225
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,...
1
7042
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...
0
7495
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...
0
5627
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,...
1
5052
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...
0
4707
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...
0
3193
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...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
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 ...

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.