473,811 Members | 2,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove network connection

I want to remove a remote access connection when a user logs out. The
connection is a dial up isdn adapter.

I can access the adapter via WMI namespace \root\microsoft \homenet, but i
don´t find any way to delete it.

Is it possible to do this or do i need to some pinvoke on rasapi32?
Oct 19 '06 #1
5 2872
Hi,
I'm sorry that I am not sure if you want to close the connection or delete
an entry when a user logs out. Could you please lighten me more on your
issue?

Anyway, according to my experiences, RAS API is required on this issue and
the P/Invoke technology provides the appropriate way on .NET platform.

Firstly, you can use RasEnumConnecti ons to emumerate all the available
active RAS connections handles on your system; Then use RasHangup to close
the connection by the handle.
If you wanted to delete the entry, please use RasEnumEntries to retrieve
the available entries, then use RasDeleteEntry to delete the entry.

For the RAS API references, please refer to:
Remote Access Service Functions
http://msdn.microsoft.com/library/de...us/rras/rras/r
as_start_page.a sp

Please feel free to let me know if you need further research on this issue.
It's my pleasure to be of assistance.

Sincerely yours,
Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========
Oct 20 '06 #2
Hi.

I want to delete the connection.

I will try with the RasDeleteEntry, do you know any way to accomplish this
via WMI?

"Charles Wang[MSFT]" <ch******@onlin e.microsoft.com wrote in message
news:ym******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi,
I'm sorry that I am not sure if you want to close the connection or delete
an entry when a user logs out. Could you please lighten me more on your
issue?

Anyway, according to my experiences, RAS API is required on this issue
and
the P/Invoke technology provides the appropriate way on .NET platform.

Firstly, you can use RasEnumConnecti ons to emumerate all the available
active RAS connections handles on your system; Then use RasHangup to close
the connection by the handle.
If you wanted to delete the entry, please use RasEnumEntries to retrieve
the available entries, then use RasDeleteEntry to delete the entry.

For the RAS API references, please refer to:
Remote Access Service Functions
http://msdn.microsoft.com/library/de...us/rras/rras/r
as_start_page.a sp

Please feel free to let me know if you need further research on this
issue.
It's my pleasure to be of assistance.

Sincerely yours,
Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no
rights.
=============== =============== =============== =========


Oct 20 '06 #3
Hi,
Thanks for your response.
Please forgive my confusion regarding your saying "delete the connection",
because generally we say that close a connection or disable a connection.
Did you mean that?

Unfortunately WMI is not designed to be able to disable a network
connection.
From this article,
https://msdn.microsoft.com/library/d...-us/wmisdk/wmi
/wmi_tasks__netw orking.asp
we can see that:
If you're using DHCP, you can use the Win32_NetworkAd apterConfigurat ion and
the ReleaseDHCPLeas e method to release the IP address. If you are not using
DHCP, you cannot use WMI to disable a network connection.

If you have any other questions or concerns, please feel free to let me
know. It is my pleasure to be of assistance.

Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========


Oct 20 '06 #4
I solved it with the rasapi32.dll.

Regards Jonas

"Charles Wang[MSFT]" <ch******@onlin e.microsoft.com wrote in message
news:10******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi,
Thanks for your response.
Please forgive my confusion regarding your saying "delete the connection",
because generally we say that close a connection or disable a connection.
Did you mean that?

Unfortunately WMI is not designed to be able to disable a network
connection.
From this article,
https://msdn.microsoft.com/library/d...-us/wmisdk/wmi
/wmi_tasks__netw orking.asp
we can see that:
If you're using DHCP, you can use the Win32_NetworkAd apterConfigurat ion
and
the ReleaseDHCPLeas e method to release the IP address. If you are not
using
DHCP, you cannot use WMI to disable a network connection.

If you have any other questions or concerns, please feel free to let me
know. It is my pleasure to be of assistance.

Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no
rights.
=============== =============== =============== =========


Oct 20 '06 #5
Hi,

Appreciate your update and response. I am glad to hear that the problem has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!

Charles Wang
Microsoft Online Community Support

=============== =============== =============== =========
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Oct 23 '06 #6

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

Similar topics

2
3946
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a test on it that if the network broken at the time the client have already send the remoting request and waiting for the server, the client side will wait infinitely by default, even if i already set the executionTimeout to 90seconds in...
2
1670
by: John Blair | last post by:
Hi, I am struggline to make my VB.Net windows client connect remotely to a MSDE database. The database is accessed ok from the remote PC when i used web forms (aspx) to access it. Can anyone provide me with an idiots guide to make the connection work from a windows client application? I get the following error:
2
1807
by: Brent Burkart | last post by:
I have a utility that I want to only run when a network connection is present. I want to plan for the situation when someone unplugs their laptop from the network and takes it into another room. My process requires a connection and I don't want it to blow up when one does not exist. I have tried using the "wininet.dll" API, but it still tells me I am connected when I am unplugged from the network. Has anyone else had the
3
2234
by: Agnes | last post by:
My client hold its MS SQL server in hkbranch, Both china and hong kong office can run the vb.net application very well via VPN. Now, they want to reduce cost and move the MS SQL server to china 's data centre . During testing period, the user cannot connect to the SQL server and alwasy got "General Network Error", we said that the network connection may not be stable and suggest move back the SQL server. However, the Network Engineer of...
8
3033
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around the plant with a wireless connection. There are some pockets of non-connectivity. I've been tasked with disabling the submit button on the form if the network is unavailable. Possible solution: I can instantiate a timed process (VB.NET 2.0
3
2093
by: Jason | last post by:
If I've got a string like x = " Intel(R) PRO/1000 CT Network Connection" How do I get x = "Intel(R) PRO/1000 CT Network Connection" I basically want to make a comparison to Intel(R) PRO/1000 CT Network Connection, since the numeric part seems to change per system.
14
2996
by: Omar Abid | last post by:
Hi, I'm using my with a program to detect an internet connection. It return true when I'm connected, but even when I 'm disconnected it returns true I don't know why ? Thx Omar Abid
1
20649
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but I don't see the error): "System.IO.IOException: Unable to read data from the transport connection:A blocking operation was interrupted by a call to WSACancelBlockingCall"
4
16105
by: Prof. William Battersea | last post by:
Hello, Suppose I have a Vista machine called VISTA and an XP machine called XP in a workgroup named WORKGROUP. Physically they're connected to a router and I can see lists of public and shared files on each of them. How do I address these for IO? A search suggested that the form open(r"\\server\folder\folder"), but I tried many combinations guessing what it wants for that path in my case (r"\\WORKGROUP\VISTA", "\\VISTA\PUBLIC", etc),...
0
9722
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
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
7664
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
5550
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
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
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.