我正在使用Snarl C# API向 snarl 发送通知。
现在我已将上述 url 的内容保存在一个名为SnarlNetwork.cs
的文件中,我的test.cs
文件内容为:
using SnarlNetworkProtocol;
using System;
class test
{
public static void Main(String[] args)
{
SNP snarl_object = new SNP();
string hostname = "localhost";
string hostport = "9887";
string appName = "Spotify";
bool val = snarl_object.register(hostname, hostport, appName);
if (val == true)
{
string title = "hello";
string message = "world";
string timeout = "5";
bool newval = snarl_object.notify(hostname, hostport, appName, null, title, message, timeout);
if (newval == true)
{
Console.WriteLine("sucessfull");
}
}
}
}
现在,当我尝试使用编译我的 test.cs 文件时csc test.cs
,出现以下错误:
C:\Users\Noob\csharp>csc test.cs
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.4926
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
test.cs(1,7): error CS0246: The type or namespace name 'SnarlNetworkProtocol' could not be found (are you missing a using directive or an assembly reference?)
那么,我在这里做错了什么,因为据我所知,我没有遗漏任何using directive
.