IW4M-Admin/Admin/Connection.cs
RaidMax 2486bc9993 added pm command
fixed connections not incrementing
fixed formatting of ban response
added ability of multiple instances running
2015-03-09 15:11:09 -05:00

42 lines
928 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace IW4MAdmin
{
class Connection
{
public Connection(String Loc)
{
Location = Loc;
ConnectionHandle = WebRequest.Create(Location);
ConnectionHandle.Proxy = null;
}
public String Read()
{
try
{
WebResponse Resp = ConnectionHandle.GetResponse();
StreamReader data_in = new StreamReader(Resp.GetResponseStream());
String result = data_in.ReadToEnd();
data_in.Close();
Resp.Close();
return result;
}
catch (System.Net.WebException E)
{
return null;
}
}
private String Location;
private WebRequest ConnectionHandle;
}
}