这就是我得到的:
:portlane.esper.net NOTICE * :*** Looking up your hostname...
:portlane.esper.net NOTICE * :*** Checking Ident
:portlane.esper.net NOTICE * :*** Found your hostname
:portlane.esper.net NOTICE * :*** No Ident response
我知道我需要在 tcp:113 上听和写,但我不知道我应该使用什么方法,或者我需要做什么。这是我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.IO;
namespace Bot
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void ConnectToServer(object sender, EventArgs e)
{
string Server = "irc.esper.net";
int Port = 5555;
string Nick = Nickname.Text;
string Channel = ChannelName.Text;
TcpClient IRCClient = new TcpClient(Server, Port);
NetworkStream Stream = IRCClient.GetStream();
StreamWriter Writer = new StreamWriter(Stream);
Writer.NewLine = "\n\r";
Writer.AutoFlush = true;
Writer.WriteLine("/USER Bot Bot Bot :Bot");
Writer.WriteLine("/nick " + Nick);
Writer.WriteLine("/join " + Channel);
Writer.WriteLine("Hello.");
StreamReader Reader = new StreamReader(Stream);
while (true)
{
Console.WriteLine(Reader.ReadLine());
}
Reader.Close();
Writer.Close();
Stream.Close();
IRCClient.Close();
Console.WriteLine("End of stream.");
}
}
}
如果你们中的任何人不介意,我们将不胜感激。
谢谢,
~ abcd3fg