Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open LAN router ports with Upnp VB.NET

Status
Not open for further replies.

DeDogs

Programmer
Jun 27, 2003
6
GB
Hi all

Program features
________________

Find the router with Upnp or a form of technology.
Open port forwarding ports 17010, 17011 and 17012 in the local lan router.
Close these ports when program closes

any ideas?



What i am thinking
__________________

Code:
        'Resource UPNPLib loaded from upnp.dll in C:\windows\system32
        Dim myDevice As UPNPLib.IUPnPDevices
        Dim devices As UPNPLib.IUPnPDeviceFinder

        Dim myDeviceID As Integer = Nothing
        Dim tmp As UInt32 = Nothing
        Dim newObject As New Object

       [COLOR=red yellow]myDeviceID = devices.CreateAsyncFind("urn:schemas-upnp-org:device:InternetGatewayDevice", tmp, newObject)[/color]
        devices.StartAsyncFind(myDeviceID)

Crashes where [COLOR=red yellow]____[/color] is with exception "Object reference not set to an instance of an object."

Thankyou Experts!
 
Im sorry i have found out the problem :D

i was not calling the library properly in vb.net

i should have been using a class

thanks though
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top