1

因此,在使用 WatiN 在 FireFox 上创建新实例时,我遇到了一些问题。

一些您可能认为重要的信息!

  1. 我能够在 IIS Express 和 winform 中运行此代码。

  2. .Net 信任级别为具有管理员凭据的完整(内部)。

  3. 我还将所有引用设置为 Copy Local = true (我在例外开始发生后这样做了)

错误发生在这里:

  public string msg(string username, string password, string msg, string group, List<string> id, bool test)
    {
        using (FireFox _FF = new FireFox())//nullreferenceexception
        {
           a lot of code
        }
    }

这就是所谓的味精:

  else if (RadioButton1.Checked)
           {
               msgbot.SetApartmentState(ApartmentState.STA);
               msgbot.Start();
               msgbot.Join();
           }
           blocker = true;
           }
           Server.Transfer("Done.aspx", true);
       }
       protected void sendmsgtobot()
       { 
       msger.msg("username", "password", TextBox1.Text , "159347", ids , false);
    }
4

0 回答 0