1、用这些东西,取了还要存库,数据量不大 ,直接存了
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
using System.Net.Sockets;
using MySql.Data.MySqlClient;
using System.Collections;
using System.Runtime.InteropServices;
2、TRY 一下,能不能连上数据库
3、TRY 一下 能不能连上设备
clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPAddress ip = IPAddress.Parse("IP");
Console.WriteLine("客户端应用程序");
Console.Write("IP地址:"+ip);
Console.WriteLine(" 端口号:"+port);
//客户端请求与服务端的连接
try
{
clientSocket.Connect(ip, port);
Console.WriteLine("服务器连接成功.");
ThreadStart Readdata = new ThreadStart(CallToRead);
Console.WriteLine("开始接受数据!");
Thread thr