Yi Meng tcp file transfer and Automatic Update system introduction (TCP File Transfer) (four)

Source: Internet
Author: User

Yi Meng tcp file transfer and Automatic Update system introduction (TCP File Transfer) (four)

Yi Meng tcp file upload download and Automatic Update system introduction (TCP File Transfer)

The system is based on the open source Networkcomms communication framework, which was previously charged, is now free and open source, the author is British, the development time of more than 5 years, the framework is very stable.

Project Address: https://item.taobao.com/item.htm?spm=686.1000925.0.0.AjdBGP&id=537538462790

Consulting qq:286275658

The idea of File download

Demo Program: HTTP://PAN.BAIDU.COM/S/1GEVFMCR

Click the code for the list on the left:

  ItemID = Listbox2.text;            Lblid.text = Listbox2.text;            Reload (ItemID);
View Code

When you click on the list on the left, the corresponding subfolder name (path name) is passed to the server. Depending on the subfolder name, the server gets a list of files in the subfolder, sent to the client, and displayed by the client.

User in the list on the right, click on a file to get the file name. and request the download of the file to the server based on the path name and file name

The code is roughly as follows:

    void Itembutton_newdownfile (object sender, Fileeventargs e) {openflag = false;            string fileName = E.fileinfo.name;            Long fileSize = e.fileinfo.size;            ULONG thefilesize = Convert.touint32 (fileSize);            Gets the current file name extension string extentname = Path.getextension (fileName);                try {string savepath = Filehelper.getpathtosave ("Select Save Path", fileName, NULL); if (Savepath! = null) {//If the user changes the name in a pop-up window, you need to manually add the extension if (!savepath.en                    Dswith (Extentname)) {Savepath = Savepath + extentname;                    }//Get the relative location of the directory such as: 201011\123456\ file. txt string fileuri = ItemID + @ "\" + fileName; try {fileinfocontract contract = new Fileinfocontract (Savepa                        th, Fileuri); Appoutter.tcpconn.sEndObject ("DownloadFile", contract); } catch (Exception ee) {MessageBox.Show (EE.                    Message); }}} catch (Exception ee) {MessageBox.Show (EE.            Message); }        }

qq:286275658

Yi Meng tcp file transfer and Automatic Update system introduction (TCP File Transfer) (four)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.