![](/img/trans.png)
[英]Receiving error of “The type or namespace name 'LayoutsPageBase' could not be found”
[英]Trying to see DOM in Chrome. Receiving SuperSocket could not be found error
我有一個VisualStudio C#WindowFormApplication。 我一直在嘗試獲取Chrome標簽的DOM。 我之前在此網站上發現了一篇帖子: 從Visual Studio訪問Chrome標簽的DOM
https://github.com/kerryjiang/SuperWebSocket/blob/master/Samples/BasicConsole/Program.cs
它詳細說明了如何做到這一點。 我將它滾動到我的程序中,我得到一個“SuperSocket”無法找到錯誤。 必須有一個我在這里缺少的參考,但我無法確定它是什么。
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;
}
}
}
}
你是對的,依賴關系似乎搞砸了。
您需要安裝以下nuget包:
- SuperSocket
- SuperSocket.WebSocket
- SuperSocket.Engine
另外,請在您的代碼中添加以下內容:
using SuperSocket.WebSocket;
告訴圖書館的維護者他的例子沒有編譯可能是一個好主意。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.