NATUPnP拒绝添加映射。
Dim upnpnat As UPnPNATClass = New UPnPNATClass
Dim mappingz As IStaticPortMappingCollection = upnpnat.StaticPortMappingCollection
mappingz.Add(200, "UDP", 200, "192.168.1.70", True, "BlockHavenClient")
它只会抛出错误:
Object reference not set to an instance of an object.
我已经将问题跟踪到了这一行:
mappingz.Add(200, "UDP", 200, "192.168.1.70", True, "BlockHavenClient")
真的坚持这个问题,请帮忙!
修改
我的路由器确实支持UPnP,即使关闭防火墙也启用了它,这不是问题。