473,796 Members | 2,444 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 2375
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.HttpWebRequ est = _
DirectCast(Net. WebRequest.Crea te("http://www.google.com" ), _
Net.HttpWebRequ est)
Dim myResp As Net.HttpWebResp onse = _
DirectCast(myRe g.GetResponse() , Net.HttpWebResp onse)
Dim myStream As IO.Stream = myResp.GetRespo nseStream()
Dim myreader As New IO.StreamReader (myStream)
Dim mystring As String = myreader.ReadTo End()
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.HttpWebRequ est = _
DirectCast(Net. WebRequest.Crea te("http://www.google.com" ), _
Net.HttpWebRequ est)
Dim myResp As Net.HttpWebResp onse = _
DirectCast(myRe g.GetResponse() , Net.HttpWebResp onse)
Dim myStream As IO.Stream = myResp.GetRespo nseStream()
Dim myreader As New IO.StreamReader (myStream)
Dim mystring As String = myreader.ReadTo End()
myResp.Close()
End Sub
End Module
///

I hope this helps a little bit?

Cor

Aug 28 '05 #5
hB
WinINet dial-up functions
InternetAutodia l
InternetAutodia lHangup
InternetDial
InternetGetConn ectedState
InternetHangUp
InternetGoOnlin e

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
InternetAutodia l
InternetAutodia lHangup
InternetDial
InternetGetConn ectedState
InternetHangUp
InternetGoOnlin e

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
2946
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 and then reference the dll with a web page as follows: <html> <body> <center> <object id="UserControl1" height="500" width="700" classid="http://wiffle/WindowsControlLibrary3.dll#WindowsControlLibrary3.UserControl1">
5
5693
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 http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere 4.0, SourceOffSite 4.1, VSS Connect 1.5, SourceXT 2.1, VSS Remoting 2.5,
3
7592
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 OleDbConnection Dim cmdSelectAuthors As OleDbCommand Dim dtrAuthors As OleDbDataReader
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) 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
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 fucntion was working on all workstations until the end of 2005 or early 2006. When a workstation that does not have the latest Windows Service Pack updates is used, the DB2 connect Client Assistant Configuration Export functions correctly.
3
11768
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 the Windows Forms app from the desktop I am able to use the Web service with no problems. On the other hand, when I run the PocketPC app and use the Web Service itthrows the following Exception -
0
2003
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 must cross a proxy server. The application runs fine through all proxy servers but one that is configured to require a "User-Agent" header. I have added the user agent string, however it does not seem to be passed during the HTTP CONNECT to...
0
2382
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. The application runs fine through all proxy servers but one that is configured to require a "User-Agent" header. I have added the user agent string, however it does not seem to be passed during the HTTP CONNECT to utilize the proxy server. ...
3
2912
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 on the java.library.path: C:\Program Files\Java\jdk1.5.0_12\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\j2sdk_nb\j2sdk1.4.2\bin;C:\Program...
0
9528
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
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 we have to send another system

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.