Home > Net >  C # receive data through the network and deposited in the Excel
C # receive data through the network and deposited in the Excel

Time:11-05

The teacher let me use the Socket network tools to do data sources, using c # to achieve the information I sent via the Socket in the Excel, how to implement this function? It's not in the foundation, don't know how to put the Excel tool associated with the Socket network, didn't find relevant information on this,

CodePudding user response:

CodePudding user response:

Two different things,
1. The Socket communication is the Socket communication,
2. The Excel is Excel operation, Excel, speaking, reading and writing data is slow, if have to use Excel to archived data, suggest the connection socket is open the Excel Application/Worksheet, closed Socekt or close the program to Excel to close off again,

CodePudding user response:

Work actually there are two parts, one is the socket receiving data, you should be used as a server, the received data should be have a fixed set of rules, according to the rules you can form a set of data,
The second is to save the data in the cache into excel file, it on the Internet has a lot of examples,

CodePudding user response:

Two parts
The first part is the communication part, c # socket, client to connect to the server (that is, your this TCP debugging assistant services), after the connection is established through events or block read listen read the server sends data.
The second step, will read the data parsing (or parsed into string stored directly, see your communication protocol), and write to specify Excel
The first step on the MSDN socket communication client example, copy the code, a port can be used instead.
The second step can use open source libraries, Excel, speaking, reading and writing NPOI, or a library called ClosedXML Microsoft Excel2007 (, speaking, reading and writing).

CodePudding user response:

Socket is responsible for receiving data, receive the data, call a stored function (example) online store data into Excel
  •  Tags:  
  • C#
  • Related