简体   繁体   English

试图在Chrome中查看DOM。 无法找到接收SuperSocket错误

[英]Trying to see DOM in Chrome. Receiving SuperSocket could not be found error

I have a VisualStudio C# WindowFormApplication. 我有一个VisualStudio C#WindowFormApplication。 I have been trying to get the DOM of a Chrome tab. 我一直在尝试获取Chrome标签的DOM。 I came across a post on this site from earlier: Accessing the DOM of a Chrome Tab from Visual Studio 我之前在此网站上发现了一篇帖子: 从Visual Studio访问Chrome标签的DOM

https://github.com/kerryjiang/SuperWebSocket/blob/master/Samples/BasicConsole/Program.cs https://github.com/kerryjiang/SuperWebSocket/blob/master/Samples/BasicConsole/Program.cs

It detailed how to accomplish this. 它详细说明了如何做到这一点。 I rolled it into my program and I get a "SuperSocket" could not be found an error. 我将它滚动到我的程序中,我得到一个“SuperSocket”无法找到错误。 There must be a reference I'm missing here, but I can't determine what it is. 必须有一个我在这里缺少的参考,但我无法确定它是什么。

using System;  
using System.Collections.Generic;  
using System.ComponentModel;  
using System.Data;  
using System.Diagnostics;  
using System.Drawing;  
using System.Linq;  
using System.Text;  
using System.Threading.Tasks;  
using System.Windows.Forms;  
using System.Windows.Automation;  
using SuperSocket.SocketBase;

namespace WindowsFormsApplication1  
{  
public partial class Form1 : System.Windows.Forms.Form  
{  
    //Global Variables  
    public static class Globals  
    {  
        public static bool EditorWorking = false;  
        public static bool WEPrompts = true;  

        public static int EditorCheck = 1;  
        public static String FuncError = "Form_Load";  
        public static String NeedToUpload = "No";  
    }  

    //private System.Windows.Forms.NotifyIcon notifyIcon1;  
    //private System.Windows.Forms.ContextMenu contextMenu1;  
    //private System.Windows.Forms.MenuItem menuItem1;  
    //private System.ComponentModel.IContainer components;  

    public Form1()  
    {  
        //InitializeComponent();  
        StartSuperWebSocket();  
        //CreateTrayIcon();  
    }  

    private void StartSuperWebSocket()  
    {  
        var appServer = new WebSocketServer();  

        //Setup the appServer  
        if (!appServer.Setup(2012)) //Setup with listening port  
        {  
            Console.WriteLine("Failed to setup!");  
            Console.ReadKey();  
            return;  
        }  

        appServer.NewMessageReceived += new SessionHandler<WebSocketSession, string>(appServer_NewMessageReceived);  

        Console.WriteLine();  

        //Try to start the appServer  
        if (!appServer.Start())  
        {  
            Console.WriteLine("Failed to start!");  
            Console.ReadKey();  
            return;  
        }  
    }  
}  
}

You are correct the dependencies seems to be messed up. 你是对的,依赖关系似乎搞砸了。

You need to install the following nuget packages: 您需要安装以下nuget包:

  1. SuperSocket SuperSocket
  2. SuperSocket.WebSocket SuperSocket.WebSocket
  3. SuperSocket.Engine SuperSocket.Engine

Also please add the following in your code: 另外,请在您的代码中添加以下内容:

using SuperSocket.WebSocket;

Might be a good idea to tell the maintainer of the library that his examples are not compiling. 告诉图书馆的维护者他的例子没有编译可能是一个好主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 收到“无法找到类型或命名空间名称'LayoutsPageBase'的错误” - Receiving error of “The type or namespace name 'LayoutsPageBase' could not be found” 无法找到DLL错误 - DLL could not be found error Mailto不会在Chrome中调用Outlook。 - Mailto does not invoke outlook in chrome. 为什么我收到“无法找到类型或命名空间名称&#39;LowLevelKeyboardProc&#39;”? - Why am I receiving “Type or namespace name 'LowLevelKeyboardProc' could not be found”? 错误:找不到试图对源类型数据表进行查询的实现,并且在尝试联接两个数据表时找不到联接 - error :Could not find an implementation of query for source type datatable and join not found while trying to join two datatables 尝试导出 fastreport 报告时无法找到元数据文件“Microsoft.CSharp”错误 - Getting a Metadata file 'Microsoft.CSharp' could not be found error upon trying to export a fastreport report 找不到 RaycastHit 错误 *Unity* - RaycastHit could not be found error *Unity* 试图解决 mvc 中的 CS0246 错误。 找不到类型或命名空间名称“XXContext” - Trying to solve CS0246 error in mvc. The type or namespace name 'XXContext' could not be found 尝试构建EFModel时收到构建错误 - Receiving Build Error When Trying To Build EFModel 我的铬测试了C#中的硒。 点击属性 - my selenium test C# in chrome. Click property
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM