TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Lovemore Kutseya
NA
21
3.7k
networking scokets c#
Feb 19 2019 3:15 PM
does anybody know how to include the command line arguments of -h, -p. Add the HTTP protocols and the arguments -h0, -h1, -h9.. struggling with this
using System;
using System.Net.Sockets;
using System.IO;
namespace location
{
public class Whois
{
static void Main(string[] args)
{
try
{
TcpClient client = new TcpClient();
client.Connect("whois.net.dcs.hull.ac.uk", 43);
StreamWriter sw = new StreamWriter(client.GetStream());
StreamReader sr = new StreamReader(client.GetStream());
if (args.Length == 1)
{
sw.WriteLine(args[0]);
sw.Flush();
string serveresponse = sr.ReadLine();
if (serveresponse == ("Error: nothing found"))
{
Console.WriteLine(serveresponse);
}
else
Console.WriteLine(args[0] + " is " + serveresponse);
}
else if (args.Length == 2)
{
sw.WriteLine(args[0] + " " + args[1]);
sw.Flush();
if (sr.ReadLine() == ("OK"))
{
Console.WriteLine(args[0] + " location changed to be " + args[1]);
}
Console.WriteLine(sr.ReadToEnd());
}
else
{
Console.WriteLine("No Arguments Provided");
}
}
catch
{
Console.WriteLine("Something Went Wrong");
}
}
}
}
Reply
Answers (
1
)
Using C# add user and give permission in SSRS
Textchange event in three tier architecture