15,907,906 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Savad.k.s (Top 4 by date)
Savad.k.s
24-Nov-15 3:02am
View
but i have a console application for this. its working fine and the out put is "ffffffff30" somthing like that
=======
console application sourcecode
======
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.IO;
//client
namespace ConsoleApplication9
{
class Program
{
static Socket sck;
static void Main(string[] args)
{
sck = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("192.168.0.177"), 80);
try
{
sck.Connect(localEndPoint);
}
catch
{
Console.Write("Unable to Connect \r\n");
Main(args);
}
Console.Write("Enter Text: ");
string text=Console.ReadLine();
byte[] data = Encoding.ASCII.GetBytes(text);
sck.Send(data);
Console.Write("Data Sent!\r\n");
Console.Write("Press any key to Continue...");
string l;
Console.Read();
byte[] bytes = new byte[15];
sck.Receive(bytes);
Console.WriteLine(Encoding.UTF8.GetString(bytes));
sck.Close();
Console.Read();
}
}
}
Savad.k.s
23-Nov-15 8:15am
View
sorry to ask.. but "int bytesRec = sender.Receive(bytes);" is there any way to change that int to string
Savad.k.s
23-Nov-15 8:13am
View
I know it is silly ... sorry about that. i am just a stater in programming world
Savad.k.s
23-Nov-15 1:05am
View
The think is i am new to this network programming... for past few years i am done only standalone accounting programs. This is a new to me. I have no idea how to accept the data from a network socket.Tired of googling cant find satisfying answer. Just tell how to accept the data or bytes and how to store into a string variable... Thanks in advance