Skip to content
This repository has been archived by the owner on Dec 29, 2017. It is now read-only.

Commit

Permalink
Pushed Source
Browse files Browse the repository at this point in the history
  • Loading branch information
EnKrypt committed Apr 26, 2012
0 parents commit 66b6da4
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README
@@ -0,0 +1,31 @@
How it came about.
***********************************************************************

For many reasons, I always wanted to make one of these.
This project is the same as JTel
Which is another project of mine - a Telnet Client in Java
This is just a Language Shift.
And my first Ptoject while learning C#

Can come very handy .
Can easily be customized to make stuff like
Automated Bots, chat clients etc

***********************************************************************

Whats more?
***********************************************************************

Pretty simple to edit and run
Figure out which parts need to customized and write and read
to/from the socket taking advantage of conditions and blah blah

Instead of the old fashoined command line host/port,
SharpTel prompts you on-screen for it.

************************************************************************

So What is JTel?

Telnet in C# .
Simple as that .
20 changes: 20 additions & 0 deletions SharpTel.sln
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpTel", "SharpTel\SharpTel.csproj", "{3D5ACDA3-EC59-446D-B491-05A9FDEAFFE7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3D5ACDA3-EC59-446D-B491-05A9FDEAFFE7}.Debug|x86.ActiveCfg = Debug|x86
{3D5ACDA3-EC59-446D-B491-05A9FDEAFFE7}.Debug|x86.Build.0 = Debug|x86
{3D5ACDA3-EC59-446D-B491-05A9FDEAFFE7}.Release|x86.ActiveCfg = Release|x86
{3D5ACDA3-EC59-446D-B491-05A9FDEAFFE7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added SharpTel.suo
Binary file not shown.
60 changes: 60 additions & 0 deletions SharpTel/Client.cs
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.IO;
using System.Threading;

namespace SharpTel{
class Client{

StreamReader input = null;

public Client(StreamReader input){
this.input = input;
}

public void Run(){
String line;
while ((line=input.ReadLine())!=null){
Console.Write(line+"\r\n");
}
}

static void Main(string[] args){
Console.Write("Host: ");
string host=Console.ReadLine();
Console.Write("Port: ");
int port;
try{
port=int.Parse(Console.ReadLine());
}
catch(Exception){
Console.WriteLine("Wrong parameter. Using 23 instead");
port=23;
}
TcpClient socket=null;
try{
socket = new TcpClient(host, port);
}
catch(SocketException){
Console.WriteLine("Unknown host - " + host + ". Quitting");
Console.ReadKey();
Environment.Exit(0);
}
NetworkStream stream = socket.GetStream();
StreamWriter output = new StreamWriter(stream);
StreamReader input = new StreamReader(stream);

Client cliobj = new Client(input);
Thread t = new Thread(new ThreadStart(cliobj.Run));
t.Start();

while(true){
output.Write(Console.ReadLine()+"\r\n");
output.Flush();
}
}
}
}
36 changes: 36 additions & 0 deletions SharpTel/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SharpTel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SharpTel")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1cb04555-aad7-4599-a097-a82795b6efef")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
57 changes: 57 additions & 0 deletions SharpTel/SharpTel.csproj
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3D5ACDA3-EC59-446D-B491-05A9FDEAFFE7}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SharpTel</RootNamespace>
<AssemblyName>SharpTel</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Client.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file added SharpTel/bin/Debug/SharpTel.exe
Binary file not shown.
Binary file added SharpTel/bin/Debug/SharpTel.pdb
Binary file not shown.
Binary file added SharpTel/bin/Debug/SharpTel.vshost.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions SharpTel/obj/x86/Debug/SharpTel.csproj.FileListAbsolute.txt
@@ -0,0 +1,5 @@
c:\users\arvind .k\documents\visual studio 2010\Projects\SharpTel\SharpTel\bin\Debug\SharpTel.exe
c:\users\arvind .k\documents\visual studio 2010\Projects\SharpTel\SharpTel\bin\Debug\SharpTel.pdb
c:\users\arvind .k\documents\visual studio 2010\Projects\SharpTel\SharpTel\obj\x86\Debug\ResolveAssemblyReference.cache
c:\users\arvind .k\documents\visual studio 2010\Projects\SharpTel\SharpTel\obj\x86\Debug\SharpTel.exe
c:\users\arvind .k\documents\visual studio 2010\Projects\SharpTel\SharpTel\obj\x86\Debug\SharpTel.pdb
Binary file added SharpTel/obj/x86/Debug/SharpTel.exe
Binary file not shown.
Binary file added SharpTel/obj/x86/Debug/SharpTel.pdb
Binary file not shown.

0 comments on commit 66b6da4

Please sign in to comment.