• C#tcp communication


    C # based on socket client and server communication Server Server interface Server code public partial class FormMain : Form { private List<Socket> ClientSockets; private BindingList<string> ClientIPPorts; private Socket socketWatch; private Socket socketSend;// send out private bool IsStart; private Action<string> ShowMsgAction; private Action UpdateListViewDataAction; public FormMain() { InitializeComponent(); ShowMsgAction += new Action<string>(ShowMsg); UpdateListViewDataAction += new […]

  • C# WinForm beginner — 01 design a simple browser


    1. Description: Recently, I want to use WinForm to design a simple browser. WinForm comes with a WebBrowser component, but WebBrowser has great limitations. It uses the IE kernel, which is very ugly after opening the web address. Therefore, after searching the data, cefsharp.com is used The WinForms browser package uses the Chrome browser kernel. […]

  • Several ways of c# operating JSON


    The importance of Jason data in development is self-evident; In c# this article, we use two common methods to realize the serialization and deserialization of JSON data. In order to meet most requirements, we use a slightly more complex data model. First, we have the following JSON data { “Name”: “Zhang San”, “age”: 20, “idCard”: […]

  • Dynamic type in C # (dynamic)


    1、 Introduction to dynamic types     Dynamic typing has been introduced in. Net 4. Dynamic object(dynamicObject)Enables you to work with structural content such as JSON documents, whose composition may not be known until runtime【The type is a static type, but the type isdynamicThe object of will skip the static type check. In most cases, […]

  • C#winform project packaged into exe file (vs2019)


    C#winform project packaged into exe file (vs2019) Step 1: Download and extend Microsoft Visual Studio installer projects1. Extension = > Management Extension 2. Enter in the search box: Microsoft Visual Studio installer projects 3. Click download, and then install according to the instructions (this figure shows that the download and installation have been completed, and […]

  • C # implementation of a simple calculator


    C # implementation of a simple calculator Environment: VS2010 and above Create a window application Drag out two textboxes from the toolbox, the first on top and the second on the bottom. The main name here is textbox1 above and textbox2 below. This involves writing the following code Drag the button in the toolbar and […]

  • C# import map (I) — use of map GMap


    catalogue Import map (this step is not necessary for networking) Download GMap and offline map Start development New WinForm project Add package Import map Move the mouse to obtain longitude and latitude Add markers to the map Add a line to the map Add polygons to the map Add pictures to the map Clear layer […]

  • WinForm UI interface design routine (I) multi window theme matching


    There will be more than 20 cases about WinForm UI interface design in this column. It does not use any third-party beautification library and is completely written in pure code. The written interface can achieve the effect of WPF interface The effect of this article is shown in the figure below. Different interfaces automatically switch […]

  • C# prepare leveling adjustment procedure


    1. Form design This program contains five forms. (1) Main form The input data includes: The output results include: (2) Form showing field observation manual (3) Form showing error assignment table (4) Form for manually entering data (5) A form that displays descriptive text 2. Code implementation 2.1 line type using System; using System.Collections.Generic; using […]

  • C# the socket based on WinForm realizes simple im in chat room


    catalogue 1: What is a socket 2: Simple communication process between customer service end and service end 3: Server code: 4: Customer service code: 5: Test effect: 6: Full code GitHub download path 7: This is just a simple chat exercise demo, which needs to be further improved (some functions are realized, and the message […]

  • The WinForm control savefiledialog is used to save files


    Savefiledialog is used to save files for your reference. The details are as follows 1. Create a new WinForm form application named savefiledialogdemo. 2. Add a button control on the interface (used to open the save file dialog box), and add a text control to input the content to be saved. 3. Background code implementation: […]

  • WinForm openfiledialog opens the file dialog box


    Openfiledialog class provides the function for users to open files. It has the following properties: attribute InitialDirectory:Set the initial directory of the dialog box. Filter:The file filter to display in the dialog box, for example, “text files (*. Txt) | *. TXT | all files (*. *) | *. *”. FilterIndex:The index of the file […]