DotRAS电话簿添加入门BUG

时间:2015-09-15 13:40:19

标签: c# ras

我正在使用DotRas版本1.3.5166(来自codeplex的最新版本) 似乎我发现了一个严重的错误=((

我想在rasphone.pbk中添加一个新条目

 foreach (Tuple<string, string> serv in servers)
            {
               // Item1 = connectionName 
               // Item2 = IP
                createEntryInPhonebook(serv.Item1, serv.Item2); // BreakPoint1 in this function
             }                                                  //BreakPoit 2

public void createEntryInPhonebook(string connectionName, string serverAddress)
        {
            if (this.phonebook.Entries.Contains(connectionName))
                return ;
            RasDevice device = RasDevice.GetDevices().Where(o => o.DeviceType == RasDeviceType.Vpn).First();
            RasEntry entry = RasEntry.CreateVpnEntry(connectionName, serverAddress, RasVpnStrategy.Default, RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn), false);
            this.phonebook.Entries.Add(entry);
        } //// BreakPoint 1

在Break Point1的第一步,我有

this.phonebook.Entries.Count = 1

但是,在我的foreach循环的第一步,我在BreakPoint 2

this.phonebook.Entries.Count = 2; // !!!!!!

内容类似!它们具有相同的连接名称,IP地址甚至this.phonebook.Entries[0].Id == this.phonebook.Entries[1].Id 在此之后,如果我尝试添加或删除任何项目,程序崩溃 我在codeplex中找到了相同的问题,提供了sample =((https://dotras.codeplex.com/releases/view/67408

0 个答案:

没有答案
相关问题