15,900,816 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 Member 12423349 (Top 14 by date)
Member 12423349
13-Apr-16 3:45am
View
ok this is probably a surfer who watch any of your code.Je looking for a way to send data between a card and a spyder pc in C # .For this must be a customer serveur.Je do this in Microsoft Visual Studio 2012 .
Member 12423349
13-Apr-16 3:34am
View
Excuse me rick zeeland said you can help me on a project in C # I am of server client on a single project or must exchange data with a spyder card and a PC the PC and the server and the spyder card and the customer 's all done in C # .Avez you code in C # ?
Member 12423349
13-Apr-16 3:18am
View
you would not simply a code in C # ?
Member 12423349
13-Apr-16 3:17am
View
You would not simply a code in C # ?
Member 12423349
12-Apr-16 11:06am
View
Thank you but I did not understand I just search a client server code in C # that not sending the characters sentences but the numbers because I have a project or spyder card must send fingerprint data and RFID a pc
Spyder card is the client and the PC and the data exchanged on the server must be nombres.Tout this must be done in C #
Member 12423349
12-Apr-16 11:00am
View
non il n'y'a cela dans mon code je vais vous envoyer mon code
TCP SERVER
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.IO;
namespace TCPserver
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Thread tcpServerRunThread = new Thread(new ThreadStart(TcpServerRun));
tcpServerRunThread.Start();
}
private void TcpServerRun()
{
TcpListener tcpListener = new TcpListener(IPAddress.Any, 5004);
tcpListener.Start();
updateUI("Listening");
while (true)
{
TcpClient client = tcpListener.AcceptTcpClient();
updateUI("Connected");
NetworkStream stream = client.GetStream();
stream.Read(x, 0, x.Length);
//updateUI("New Message = " + Encoding.ASCII.GetString(message));
UInt32 u = (UInt32)(x[0] << 24) | (UInt32)(x[1] << 16) | (UInt32)(x[2] << 8) | (UInt32)x[3];
updateUI("u = " + u.ToString("X"));
stream.Close();
client.Close();
}
}
/*
private void TcpServerRun()
{
TcpListener tcpListener = new TcpListener(IPAddress.Any,5004);
tcpListener.Start();
updateUI("Listening");
while(true)
{
TcpClient client = tcpListener.AcceptTcpClient();
updateUI("Connected");
Thread tcpHandlerThread = new Thread(new ParameterizedThreadStart(tcpHandler));
tcpHandlerThread.Start(client);
}
}
private void tcpHandler (object client)
{
TcpClient mClient = (TcpClient)client;
NetworkStream stream = mClient.GetStream();
byte[] message = new byte[1024];
stream.Read(message, 0,message.Length);
updateUI("New Message = " + Encoding .ASCII.GetString(message));
stream.Close();
mClient.Close();
}
*/
private void updateUI(string s)
{
Func<int> del = delegate()
{
textBox1.AppendText(s + System.Environment.NewLine);
return 0;
};
Invoke(del);
}
}
}
TEST CLIENT TCP
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Net;
using System.IO;
using System.Threading;
namespace TestClientTCP
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Thread mThread = new Thread(new ThreadStart(ConnectAsClient));
mThread.Start();
}
private void ConnectAsClient()
{
TcpClient client = new TcpClient();
client.Connect(IPAddress.Parse("192.168.230.1"), 5004);
updateUI("Connected");
NetworkStream stream = client.GetStream();
string s = "Hello from client";
//UInt32 u = 0x41424344;
//
Member 12423349
12-Apr-16 10:53am
View
your code does not work
Member 12423349
12-Apr-16 10:49am
View
It just so you can send numbers instead of characters in a client server project
Member 12423349
12-Apr-16 10:42am
View
I want you to do a client server by sending digital data code in my project because there must be a spyder card for data sending to my pc so I had to create a client server
Member 12423349
12-Apr-16 10:28am
View
Yes exactly send donneées binary instead of text I 'm stuck in some of my code and I can not send numbers to the server
Member 12423349
12-Apr-16 10:26am
View
Yes
Member 12423349
12-Apr-16 10:25am
View
Yes exactly send donneées binary instead of text I 'm stuck in some of my code and I can not send numbers to the server
Member 12423349
12-Apr-16 10:17am
View
How can I send digital or binary data in a client project / server in C #
Member 12423349
12-Apr-16 10:16am
View
tried a client single server in C # using Microsoft Visual Studio 2012 and it worked but sent data are phrases like "Message sent" I am trying to send binary data numbers for my project because I work with the spyder card that plays the role of client and the pC that acts as serveur.La spyder card is sent to the pC binary messages as RFID data or fingerprint data .It is therefore necessary to define this message size . I really need aide.Merci for the person who will help me in my project.
Show More