Hello,
I am the new one. I am sorry for my not so good english, I am not an
native.
I have a problem and I hope somebody can help me.
Target System is XPE.
.NET Version 3.5
For an installtion I am writing a small tool which enable the ICS on
the Contoll-PC of our machine.
Also the tool is adding some mapped ports.
So it should do the same, if you choose a network adapter, properties -
> advanced
"Internet Connection Sharing" --> Allow (enable) --> settings (adding
ports)
All this stuff is working, see code below.
But I have one problem.
I the shown screen (in case of enter the ports manually) you have to
choose a "Home networking connection" which should be one of my 3
network cards.
But I am unable to select this in my code. And I have no idea how does
it work.
I am using the NETCONLib for this.
my code, not complete, but so you can see what I do.
If there is a better way to do it, please tell me.
static void Main(string[] args)
{
NETCONLib.NetSharingManagerClass ns = new
NETCONLib.NetSharingManagerClass();
foreach (NETCONLib.INetConnection c in ns.EnumEveryConnection)
{
NETCONLib.INetConnectionProps p = ns.get_NetConnectionProps(c);
NETCONLib.INetSharingConfiguration sc =
ns.get_INetSharingConfigurationForINetConnection(c);
try
{
string bernd = sc.InternetFirewallEnabled.ToString();
sc.AddPortMapping("MAPPEDPORT1", 6, 12722, 12722, 0, "127.0.0.1",
NETCONLib.tagICS_TARGETTYPE.ICSTT_IPADDRESS).Enable();
sc.EnableSharing(sc.SharingConnectionType);
}
catch (Exception)
{
//......
}
}
}
This part of my code is working for me, so I have only the above
mentioned problem.
I will say thanks for your help in advance.
Michael