代码重构,文件服务器机制优化,服务器端合并所有的高级文件服务器功能。

This commit is contained in:
dathlin
2017-09-17 21:59:45 +08:00
parent 869728db65
commit 78c04eadfb
13 changed files with 865 additions and 165 deletions

View File

@@ -0,0 +1,442 @@
namespace ClientsLibrary.AccountSupport
{
partial class AccountDetails
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.textBox_UserName = new System.Windows.Forms.TextBox();
this.textBox_NameAlias = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBox_Factory = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox_GradeDescription = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textBox_RegisterTime = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox_LoginEnable = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox_LoginFrequency = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.textBox_LastLoginTime = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.textBox_LastLoginIpAddress = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.textBox_LastLoginWay = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.textBox_LoginFailedCount = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.treeView1 = new System.Windows.Forms.TreeView();
this.userButton_upload = new HslCommunication.Controls.UserButton();
this.userButton1 = new HslCommunication.Controls.UserButton();
this.userButton2 = new HslCommunication.Controls.UserButton();
this.label12 = new System.Windows.Forms.Label();
this.pictureBox_UserPortrait = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_UserPortrait)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox1.Controls.Add(this.pictureBox_UserPortrait);
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.textBox_LoginFailedCount);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.textBox_LastLoginWay);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.textBox_LastLoginIpAddress);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.textBox_LastLoginTime);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.textBox_LoginFrequency);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.textBox_LoginEnable);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.textBox_RegisterTime);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.textBox_GradeDescription);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.textBox_Factory);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.textBox_NameAlias);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.textBox_UserName);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(304, 492);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "账户信息";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(20, 167);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 17);
this.label1.TabIndex = 0;
this.label1.Text = "用户名:";
//
// textBox_UserName
//
this.textBox_UserName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_UserName.Location = new System.Drawing.Point(112, 164);
this.textBox_UserName.Name = "textBox_UserName";
this.textBox_UserName.ReadOnly = true;
this.textBox_UserName.Size = new System.Drawing.Size(177, 23);
this.textBox_UserName.TabIndex = 1;
//
// textBox_NameAlias
//
this.textBox_NameAlias.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_NameAlias.Location = new System.Drawing.Point(112, 194);
this.textBox_NameAlias.Name = "textBox_NameAlias";
this.textBox_NameAlias.ReadOnly = true;
this.textBox_NameAlias.Size = new System.Drawing.Size(177, 23);
this.textBox_NameAlias.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(20, 197);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 2;
this.label2.Text = "别名:";
//
// textBox_Factory
//
this.textBox_Factory.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_Factory.Location = new System.Drawing.Point(112, 223);
this.textBox_Factory.Name = "textBox_Factory";
this.textBox_Factory.ReadOnly = true;
this.textBox_Factory.Size = new System.Drawing.Size(177, 23);
this.textBox_Factory.TabIndex = 5;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(20, 226);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 4;
this.label3.Text = "工厂:";
//
// textBox_GradeDescription
//
this.textBox_GradeDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_GradeDescription.Location = new System.Drawing.Point(112, 251);
this.textBox_GradeDescription.Name = "textBox_GradeDescription";
this.textBox_GradeDescription.ReadOnly = true;
this.textBox_GradeDescription.Size = new System.Drawing.Size(177, 23);
this.textBox_GradeDescription.TabIndex = 7;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(20, 254);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17);
this.label4.TabIndex = 6;
this.label4.Text = "权限:";
//
// textBox_RegisterTime
//
this.textBox_RegisterTime.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_RegisterTime.Location = new System.Drawing.Point(112, 279);
this.textBox_RegisterTime.Name = "textBox_RegisterTime";
this.textBox_RegisterTime.ReadOnly = true;
this.textBox_RegisterTime.Size = new System.Drawing.Size(177, 23);
this.textBox_RegisterTime.TabIndex = 9;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(20, 282);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(68, 17);
this.label5.TabIndex = 8;
this.label5.Text = "注册时间:";
//
// textBox_LoginEnable
//
this.textBox_LoginEnable.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_LoginEnable.Location = new System.Drawing.Point(112, 308);
this.textBox_LoginEnable.Name = "textBox_LoginEnable";
this.textBox_LoginEnable.ReadOnly = true;
this.textBox_LoginEnable.Size = new System.Drawing.Size(177, 23);
this.textBox_LoginEnable.TabIndex = 11;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(20, 311);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(92, 17);
this.label6.TabIndex = 10;
this.label6.Text = "是否允许登录:";
//
// textBox_LoginFrequency
//
this.textBox_LoginFrequency.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_LoginFrequency.Location = new System.Drawing.Point(112, 338);
this.textBox_LoginFrequency.Name = "textBox_LoginFrequency";
this.textBox_LoginFrequency.ReadOnly = true;
this.textBox_LoginFrequency.Size = new System.Drawing.Size(177, 23);
this.textBox_LoginFrequency.TabIndex = 13;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(20, 341);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(80, 17);
this.label7.TabIndex = 12;
this.label7.Text = "总登录次数:";
//
// textBox_LastLoginTime
//
this.textBox_LastLoginTime.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_LastLoginTime.Location = new System.Drawing.Point(112, 368);
this.textBox_LastLoginTime.Name = "textBox_LastLoginTime";
this.textBox_LastLoginTime.ReadOnly = true;
this.textBox_LastLoginTime.Size = new System.Drawing.Size(177, 23);
this.textBox_LastLoginTime.TabIndex = 15;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(20, 371);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(92, 17);
this.label8.TabIndex = 14;
this.label8.Text = "上次登录时间:";
//
// textBox_LastLoginIpAddress
//
this.textBox_LastLoginIpAddress.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_LastLoginIpAddress.Location = new System.Drawing.Point(112, 398);
this.textBox_LastLoginIpAddress.Name = "textBox_LastLoginIpAddress";
this.textBox_LastLoginIpAddress.ReadOnly = true;
this.textBox_LastLoginIpAddress.Size = new System.Drawing.Size(177, 23);
this.textBox_LastLoginIpAddress.TabIndex = 17;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(20, 401);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(92, 17);
this.label9.TabIndex = 16;
this.label9.Text = "上次登录地址:";
//
// textBox_LastLoginWay
//
this.textBox_LastLoginWay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_LastLoginWay.Location = new System.Drawing.Point(112, 428);
this.textBox_LastLoginWay.Name = "textBox_LastLoginWay";
this.textBox_LastLoginWay.ReadOnly = true;
this.textBox_LastLoginWay.Size = new System.Drawing.Size(177, 23);
this.textBox_LastLoginWay.TabIndex = 19;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(20, 431);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(92, 17);
this.label10.TabIndex = 18;
this.label10.Text = "上次登录方式:";
//
// textBox_LoginFailedCount
//
this.textBox_LoginFailedCount.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox_LoginFailedCount.Location = new System.Drawing.Point(112, 459);
this.textBox_LoginFailedCount.Name = "textBox_LoginFailedCount";
this.textBox_LoginFailedCount.ReadOnly = true;
this.textBox_LoginFailedCount.Size = new System.Drawing.Size(177, 23);
this.textBox_LoginFailedCount.TabIndex = 21;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(20, 462);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(92, 17);
this.label11.TabIndex = 20;
this.label11.Text = "登录失败次数:";
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.userButton2);
this.groupBox2.Controls.Add(this.userButton1);
this.groupBox2.Controls.Add(this.userButton_upload);
this.groupBox2.Controls.Add(this.treeView1);
this.groupBox2.Location = new System.Drawing.Point(322, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(373, 492);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "个人文件";
//
// treeView1
//
this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.treeView1.Location = new System.Drawing.Point(10, 24);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(353, 429);
this.treeView1.TabIndex = 0;
//
// userButton_upload
//
this.userButton_upload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton_upload.BackColor = System.Drawing.Color.Transparent;
this.userButton_upload.CustomerInformation = "";
this.userButton_upload.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton_upload.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton_upload.Location = new System.Drawing.Point(10, 460);
this.userButton_upload.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton_upload.Name = "userButton_upload";
this.userButton_upload.Size = new System.Drawing.Size(65, 23);
this.userButton_upload.TabIndex = 8;
this.userButton_upload.UIText = "上传";
//
// userButton1
//
this.userButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton1.BackColor = System.Drawing.Color.Transparent;
this.userButton1.CustomerInformation = "";
this.userButton1.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton1.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton1.Location = new System.Drawing.Point(81, 460);
this.userButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton1.Name = "userButton1";
this.userButton1.Size = new System.Drawing.Size(65, 23);
this.userButton1.TabIndex = 9;
this.userButton1.UIText = "下载";
//
// userButton2
//
this.userButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.userButton2.BackColor = System.Drawing.Color.Transparent;
this.userButton2.CustomerInformation = "";
this.userButton2.EnableColor = System.Drawing.Color.FromArgb(((int)(((byte)(190)))), ((int)(((byte)(190)))), ((int)(((byte)(190)))));
this.userButton2.Font = new System.Drawing.Font("微软雅黑", 9F);
this.userButton2.Location = new System.Drawing.Point(297, 460);
this.userButton2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.userButton2.Name = "userButton2";
this.userButton2.Size = new System.Drawing.Size(65, 23);
this.userButton2.TabIndex = 10;
this.userButton2.UIText = "删除";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(20, 24);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(44, 17);
this.label12.TabIndex = 22;
this.label12.Text = "头像:";
//
// pictureBox_UserPortrait
//
this.pictureBox_UserPortrait.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox_UserPortrait.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox_UserPortrait.Location = new System.Drawing.Point(112, 22);
this.pictureBox_UserPortrait.Name = "pictureBox_UserPortrait";
this.pictureBox_UserPortrait.Size = new System.Drawing.Size(136, 136);
this.pictureBox_UserPortrait.TabIndex = 23;
this.pictureBox_UserPortrait.TabStop = false;
//
// AccountDetails
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(706, 516);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(722, 555);
this.MinimumSize = new System.Drawing.Size(722, 555);
this.Name = "AccountDetails";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "AccountDetails";
this.Load += new System.EventHandler(this.AccountDetails_Load);
this.Shown += new System.EventHandler(this.AccountDetails_Shown);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox_UserPortrait)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox_LoginFailedCount;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox_LastLoginWay;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox textBox_LastLoginIpAddress;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox_LastLoginTime;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBox_LoginFrequency;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox_LoginEnable;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox_RegisterTime;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox_GradeDescription;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox_Factory;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox_NameAlias;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox_UserName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TreeView treeView1;
private HslCommunication.Controls.UserButton userButton2;
private HslCommunication.Controls.UserButton userButton1;
private HslCommunication.Controls.UserButton userButton_upload;
private System.Windows.Forms.PictureBox pictureBox_UserPortrait;
private System.Windows.Forms.Label label12;
}
}

View File

@@ -0,0 +1,56 @@
using CommonLibrary;
using HslCommunication.Enthernet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ClientsLibrary.AccountSupport
{
public partial class AccountDetails : Form
{
public AccountDetails(AdvancedFileClient fileClient, UserPortrait userPortrait)
{
InitializeComponent();
FileClient = fileClient;
UserPortrait = userPortrait;
}
private void AccountDetails_Shown(object sender, EventArgs e)
{
// 加载各种数据
textBox_Factory.Text = UserClient.UserAccount.Factory;
textBox_GradeDescription.Text = AccountGrade.GetDescription(UserClient.UserAccount.Grade);
textBox_LastLoginIpAddress.Text = UserClient.UserAccount.LastLoginIpAddress;
textBox_LastLoginTime.Text = UserClient.UserAccount.LastLoginTime.ToString();
textBox_LastLoginWay.Text = UserClient.UserAccount.LastLoginWay;
textBox_LoginEnable.Text = UserClient.UserAccount.LoginEnable ? "允许" : "禁止";
textBox_LoginFailedCount.Text = UserClient.UserAccount.LoginFailedCount.ToString();
textBox_LoginFrequency.Text = UserClient.UserAccount.LoginFrequency.ToString();
textBox_NameAlias.Text = UserClient.UserAccount.NameAlias;
textBox_RegisterTime.Text = UserClient.UserAccount.RegisterTime.ToString();
textBox_UserName.Text = UserClient.UserAccount.UserName;
// 加载头像
}
private void AccountDetails_Load(object sender, EventArgs e)
{
Text = "账户详细信息";
}
public AdvancedFileClient FileClient { get; }
public UserPortrait UserPortrait { get; }
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -12,6 +12,16 @@ using System.Windows.Forms;
namespace ClientsLibrary
{
/********************************************************************************
*
* 2017917 16:09:05
*
*
*********************************************************************************/
/// <summary>
/// 头像管理类
/// </summary>
@@ -62,8 +72,8 @@ namespace ClientsLibrary
bitmap300.Dispose();
bitmap32.Dispose();
using (FormFileOperate ffo = new FormFileOperate(CommonHeadCode.KeyToken,UserClient.LogNet, new System.Net.IPEndPoint(
System.Net.IPAddress.Parse(UserClient.ServerIp), CommonLibrary.CommonLibrary.Port_Portrait_Server),
using (FormFileOperate ffo = new FormFileOperate(
UserClient.Net_File_Client,
new string[]
{
path300,
@@ -131,6 +141,7 @@ namespace ClientsLibrary
/// <param name="path"></param>
public void DownloadUserPortraint(string path)
{
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode., UserClient.UserAccount.UserName);
if (result.IsSuccess)
{
@@ -150,22 +161,45 @@ namespace ClientsLibrary
public void ThreadPoolDownloadSizeLarge()
{
string path = FileSavePath;
OperateResultString result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode., UserClient.UserAccount.UserName, null, null);
if (result.IsSuccess)
string path300 = path + @"\" + PortraitSupport.LargePortrait;
// 利用客户端文件引擎去下载文件
OperateResult operateResult = UserClient.Net_File_Client.DownloadFile(
PortraitSupport.LargePortrait,
"Files",
"Portrait",
UserClient.UserAccount.UserName,
null,
path300
);
if(operateResult.IsSuccess)
{
if (result.Content[0] == 'Y')
{
byte[] data = Convert.FromBase64String(result.Content.Substring(1));
string path32 = path + @"\" + PortraitSupport.LargePortrait;
System.IO.File.WriteAllBytes(path32, data);
System.Diagnostics.Process.Start(path32);
data = null;
}
System.Diagnostics.Process.Start(path300);
}
Thread.Sleep(1000);
}
#endregion
#region Public Method
/// <summary>
///
/// </summary>
/// <returns></returns>
public string GetLargePortraitFileName()
{
return FileSavePath + @"\" + PortraitSupport.LargePortrait;
}
public string GetSmallPortraitFileName()
{
return FileSavePath + @"\" + PortraitSupport.SmallPortrait;
}
#endregion
#region Private Members

View File

@@ -49,6 +49,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AccountSupport\AccountDetails.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AccountSupport\AccountDetails.Designer.cs">
<DependentUpon>AccountDetails.cs</DependentUpon>
</Compile>
<Compile Include="AccountSupport\AccountLogin.cs" />
<Compile Include="BasicSupport\FormDownloading.cs">
<SubType>Form</SubType>
@@ -94,9 +100,12 @@
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserClient.cs" />
<Compile Include="UserPortrait.cs" />
<Compile Include="AccountSupport\UserPortrait.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AccountSupport\AccountDetails.resx">
<DependentUpon>AccountDetails.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BasicSupport\FormDownloading.resx">
<DependentUpon>FormDownloading.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -36,9 +36,13 @@ namespace ClientsLibrary
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
using (FormFileOperate fUpload = new FormFileOperate(CommonHeadCode.KeyToken,UserClient.LogNet, new System.Net.IPEndPoint(
System.Net.IPAddress.Parse(UserClient.ServerIp), CommonLibrary.CommonLibrary.Port_Update_Remote),
ofd.FileNames, "", "", ""))
using (FormFileOperate fUpload = new FormFileOperate(
UserClient.Net_File_Client,
ofd.FileNames,
"ClientFiles",
"",
""
))
{
fUpload.ShowDialog();
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using HslCommunication.Enthernet;
using HslCommunication.BasicFramework;
using CommonLibrary;
using System.Net;
namespace ClientsLibrary
{
@@ -48,6 +49,7 @@ namespace ClientsLibrary
/// <summary>
/// 所有版本更新信息的对象
/// </summary>
@@ -84,7 +86,7 @@ namespace ClientsLibrary
/// <summary>
/// 用于访问服务器数据的网络对象类,必须修改这个端口参数,否则运行失败
/// </summary>
public static NetSimplifyClient Net_simplify_client = new NetSimplifyClient(
public static NetSimplifyClient Net_simplify_client { get; set; } = new NetSimplifyClient(
new System.Net.IPEndPoint(System.Net.IPAddress.Parse(ServerIp),
CommonLibrary.CommonLibrary.Port_Second_Net))
{
@@ -95,13 +97,24 @@ namespace ClientsLibrary
/// <summary>
/// 用于使用udp向服务器进行发送即时可丢失数据的对象
/// </summary>
public static NetUdpClient Net_Udp_Client = new NetUdpClient(
public static NetUdpClient Net_Udp_Client { get; set; } = new NetUdpClient(
new System.Net.IPEndPoint(System.Net.IPAddress.Parse(ServerIp),
CommonLibrary.CommonLibrary.Port_Udp_Server))
{
KeyToken = CommonHeadCode.KeyToken,
};
/// <summary>
/// 用于特殊用途的文件上传下载操作
/// </summary>
public static AdvancedFileClient Net_File_Client { get; set; } = new AdvancedFileClient()
{
KeyToken = CommonHeadCode.KeyToken,
LogNet = LogNet,
ServerIpEndPoint = new IPEndPoint(IPAddress.Parse(ServerIp), CommonLibrary.CommonLibrary.Port_Advanced_File_Server)
};
/// <summary>
/// 客户端的日志纪录对象
/// </summary>

View File

@@ -79,11 +79,14 @@ namespace CommonLibrary
/// </summary>
public static int Port_Udp_Server { get; } = 32566;
/// <summary>
/// 头像管理的服务器端口
/// 文件管理的服务器端口
/// </summary>
public static int Port_Portrait_Server { get; } = 24672;
public static int Port_Advanced_File_Server { get; } = 24672;
#endregion
/// <summary>
/// 整个系统的加密解密密码
/// </summary>

View File

@@ -19,7 +19,7 @@ namespace CommonLibrary
/// <summary>
/// 用于同步和异步的网络的身份令牌,提升安全性
/// 用于整个网络服务交互的身份令牌,可有效的防止来自网络的攻击,重新生成令牌后就无法更改,否则不支持自动升级
/// </summary>
public static Guid KeyToken { get; set; } = new Guid("1275BB9A-14B2-4A96-9673-B0AF0463D474");

Binary file not shown.

View File

@@ -2132,80 +2132,36 @@
刷新客户端的文件信息
</summary>
</member>
<member name="T:HslCommunication.Enthernet.FileClient">
<member name="T:HslCommunication.Enthernet.FileClientBase">
<summary>
文件传送中的客户端类
文件传客户端
</summary>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.DeleteFile(System.String,System.Int32,System.String)">
<member name="P:HslCommunication.Enthernet.FileClientBase.ServerIpEndPoint">
<summary>
服务器端的文件管理引擎终结点
</summary>
</member>
<member name="M:HslCommunication.Enthernet.FileClientBase.DeleteFileBase(System.String)">
<summary>
删除服务器上的文件
</summary>
<param name="serverIp"></param>
<param name="serverPort"></param>
<param name="fileName"></param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.DeleteFile(System.Net.IPEndPoint,System.String)">
<summary>
删除服务器上的文件
</summary>
<param name="iPEndPoint">服务器的终结点</param>
<param name="fileName">文件的名称</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.DownloadFile(System.String,System.Int32,System.String,System.Action{System.Int64,System.Int64},System.String)">
<member name="M:HslCommunication.Enthernet.FileClientBase.DownloadFileBase(System.String,System.Action{System.Int64,System.Int64},System.String)">
<summary>
下载文件信息
基础下载文件信息
</summary>
<param name="serverIp"></param>
<param name="serverPort"></param>
<param name="fileName"></param>
<param name="processReport"></param>
<param name="fileSaveName"></param>
<param name="fileName">服务器的文件名称</param>
<param name="processReport">下载的进度报告</param>
<param name="fileSaveName">本地保存的文件名称,包含完整路径名</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.DownloadFile(System.Net.IPEndPoint,System.String,System.Action{System.Int64,System.Int64},System.String)">
<summary>
下载文件信息
</summary>
<param name="iPEndPoint"></param>
<param name="fileName"></param>
<param name="processReport"></param>
<param name="fileSaveName"></param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.UploadFileAdvanced(System.Net.IPEndPoint,System.String,System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
<summary>
上传文件给文件管理服务器
</summary>
<param name="iPEndPoint"></param>
<param name="fileName">本地完整路径的文件名</param>
<param name="serverName">文件名称</param>
<param name="factory">工厂大类,第一级大类</param>
<param name="group">类别小类,第二级分类</param>
<param name="id">标识号类,第三级分类</param>
<param name="processReport">汇报进度</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.UploadFile(System.String,System.Int32,System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
<member name="M:HslCommunication.Enthernet.FileClientBase.UploadFileBase(System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
<summary>
上传文件给服务器
</summary>
<param name="serverIp">服务器的ip地址</param>
<param name="serverPort">服务器的端口号</param>
<param name="fileName">本地完整路径的文件名</param>
<param name="serverName">在服务器保存的文件名,不包含驱动器路径</param>
<param name="fileTag"></param>
<param name="fileUpload"></param>
<param name="processReport">汇报进度</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.UploadFile(System.Net.IPEndPoint,System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
<summary>
上传文件给服务器
</summary>
<param name="iPEndPoint">远程终结点</param>
<param name="fileName">本地完整路径的文件名</param>
<param name="serverName">在服务器保存的文件名,不包含驱动器路径</param>
<param name="fileTag">文件的描述</param>
@@ -2213,7 +2169,97 @@
<param name="processReport">汇报进度</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.FileClient.DownloadPathFileNames(System.Net.IPEndPoint,System.String[]@,System.String,System.String,System.String)">
<member name="T:HslCommunication.Enthernet.SimpleFileClient">
<summary>
共享文件客户端类,负责共享文件的文件上传,下载,删除等等操作
</summary>
</member>
<member name="M:HslCommunication.Enthernet.SimpleFileClient.DeleteFile(System.String)">
<summary>
删除服务器的文件操作
</summary>
<param name="fileName">文件名称,带后缀</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.SimpleFileClient.DownloadFile(System.String,System.Action{System.Int64,System.Int64},System.String)">
<summary>
下载服务器的文件到本地的文件操作
</summary>
<param name="fileName">文件名称,带后缀</param>
<param name="processReport">下载的进度报告</param>
<param name="fileSaveName">准备本地保存的名称</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.SimpleFileClient.UploadFile(System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
<summary>
上传本地的文件到服务器操作
</summary>
<param name="fileName">本地的完整路径的文件名称</param>
<param name="serverName"></param>
<param name="fileTag"></param>
<param name="fileUpload"></param>
<param name="processReport"></param>
<returns></returns>
</member>
<member name="T:HslCommunication.Enthernet.AdvancedFileClient">
<summary>
负责分类文件传输的客户端,用来上传,下载信息
</summary>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileClient.DeleteFile(System.String,System.String,System.String,System.String)">
<summary>
删除服务器的文件操作
</summary>
<param name="fileName">文件名称,带后缀</param>
<param name="factory">第一大类</param>
<param name="group">第二大类</param>
<param name="id">第三大类</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileClient.DownloadFile(System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64},System.String)">
<summary>
下载服务器的文件到本地的文件操作
</summary>
<param name="fileName">文件名称,带后缀</param>
<param name="factory">第一大类</param>
<param name="group">第二大类</param>
<param name="id">第三大类</param>
<param name="processReport">下载的进度报告</param>
<param name="fileSaveName">准备本地保存的名称</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileClient.UploadFile(System.String,System.String,System.String,System.String,System.String,System.Action{System.Int64,System.Int64})">
<summary>
上传本地的文件到服务器操作
</summary>
<param name="fileName">本地的完整路径的文件名称</param>
<param name="serverName">服务器存储的文件名称,带后缀</param>
<param name="factory">第一大类</param>
<param name="group">第二大类</param>
<param name="id">第三大类</param>
<param name="processReport">上传的进度报告</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileClient.TranslateFileName(System.String,System.String,System.String,System.String)">
<summary>
根据三种分类信息,还原成在服务器的相对路径,包含文件
</summary>
<param name="fileName">文件名称,包含后缀名</param>
<param name="factory">第一类</param>
<param name="group">第二类</param>
<param name="id">第三类</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileClient.TranslatePathName(System.String,System.String,System.String)">
<summary>
根据三种分类信息,还原成在服务器的相对路径,仅仅路径
</summary>
<param name="factory">第一类</param>
<param name="group">第二类</param>
<param name="id">第三类</param>
<returns></returns>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileClient.DownloadPathFileNames(System.Net.IPEndPoint,System.String[]@,System.String,System.String,System.String)">
<summary>
获取指定路径下的所有的文档
</summary>
@@ -2226,7 +2272,7 @@
</member>
<member name="T:HslCommunication.Enthernet.AdvancedFileServer">
<summary>
文件传送类服务器,仅仅负责数据传送部分,不负责数据库的存储
文件管理类服务器,负责服务器所有分类文件的管理,仅仅负责本地文件的存储
</summary>
</member>
<member name="M:HslCommunication.Enthernet.AdvancedFileServer.ThreadPoolLogin(System.Object)">
@@ -2772,33 +2818,27 @@
上传或下载的控件
</summary>
</member>
<member name="M:HslCommunication.Enthernet.FileOperateControl.#ctor(HslCommunication.LogNet.ILogNet,System.Guid,System.Net.IPEndPoint,System.String,System.String,System.String,System.String)">
<member name="M:HslCommunication.Enthernet.FileOperateControl.#ctor(HslCommunication.Enthernet.AdvancedFileClient,System.String,System.String,System.String,System.String)">
<summary>
上传的实例化方法
</summary>
<param name="logNet">日志组件</param>
<param name="token">网络令牌</param>
<param name="endpoint">服务器的端口地址</param>
<param name="filepath">完整的文件路径</param>
<param name="advancedFile">客户端文件传送引擎</param>
<param name="filepath">完整的包含路径的本地文件路径</param>
<param name="factory">文件所属的工厂</param>
<param name="group">文件所属的分类</param>
<param name="id">文件所属的设备ID</param>
</member>
<member name="M:HslCommunication.Enthernet.FileOperateControl.#ctor(HslCommunication.LogNet.ILogNet,System.Guid,System.Net.IPEndPoint,System.String,System.String)">
<member name="M:HslCommunication.Enthernet.FileOperateControl.#ctor(HslCommunication.Enthernet.AdvancedFileClient,System.String,System.String,System.String,System.String,System.String)">
<summary>
下载的实例化方法
</summary>
<param name="logNet">日志组件</param>
<param name="token">网络令牌</param>
<param name="endpoint">服务器的端口地址</param>
<param name="filepath">服务器的文件路径</param>
<param name="advancedFile">客户端文件传送引擎</param>
<param name="fileName">服务器的文件名称,包含后缀</param>
<param name="factory">文件所属的第一大类</param>
<param name="group">文件所属的第二大类</param>
<param name="id">文件所属的第三大类</param>
<param name="savepath">本地保存的路径</param>
</member>
<member name="P:HslCommunication.Enthernet.FileOperateControl.IpEndServer">
<summary>
服务器地址终结点
</summary>
</member>
<member name="P:HslCommunication.Enthernet.FileOperateControl.IsOperateFinished">
<summary>
指示本次上传或是下载是否结束
@@ -2861,26 +2901,25 @@
用于文件上传或下载的窗口
</summary>
</member>
<member name="M:HslCommunication.Enthernet.FormFileOperate.#ctor(System.Guid,HslCommunication.LogNet.ILogNet,System.Net.IPEndPoint,System.String[],System.String,System.String,System.String)">
<member name="M:HslCommunication.Enthernet.FormFileOperate.#ctor(HslCommunication.Enthernet.AdvancedFileClient,System.String[],System.String,System.String,System.String)">
<summary>
实例化一个文件上传的窗口
</summary>
<param name="token">网络令牌</param>
<param name="logNet">日志组件</param>
<param name="endpoint">服务器远程地址</param>
<param name="advancedFile">客户端的文件引擎</param>
<param name="files">等待上传的文件数组</param>
<param name="factory">工厂大类</param>
<param name="group"></param>
<param name="id">设备序号</param>
<param name="factory">第一大类</param>
<param name="group">第二大</param>
<param name="id">第三大类</param>
</member>
<member name="M:HslCommunication.Enthernet.FormFileOperate.#ctor(System.Guid,HslCommunication.LogNet.ILogNet,System.Net.IPEndPoint,System.String[],System.String)">
<member name="M:HslCommunication.Enthernet.FormFileOperate.#ctor(HslCommunication.Enthernet.AdvancedFileClient,System.String[],System.String,System.String,System.String,System.String)">
<summary>
实例化一个文件下载的窗口
</summary>
<param name="token">网络令牌</param>
<param name="logNet">日志组件</param>
<param name="endpoint">服务器的远程地址</param>
<param name="advancedFile">客户端的文件传送引擎</param>
<param name="files">等待下载的文件</param>
<param name="factory">第一大类</param>
<param name="group">第二大类</param>
<param name="id">第三大类</param>
<param name="savepath">保存路径</param>
</member>
<member name="P:HslCommunication.Enthernet.FormFileOperate.is_down_file">

View File

@@ -17,6 +17,7 @@ using System.Windows.Shapes;
using HslCommunication;
using System.Threading;
using System.IO;
using System.Net;
namespace Wpf.Views
{
@@ -29,10 +30,11 @@ namespace 软件系统客户端Wpf.Views
{
InitializeComponent();
fileClient = new FileClient()
fileClient = new SimpleFileClient()
{
KeyToken = CommonLibrary.CommonHeadCode.KeyToken,
LogNet = UserClient.LogNet,
ServerIpEndPoint =new IPEndPoint(IPAddress.Parse(UserClient.ServerIp),CommonLibrary.CommonLibrary.Port_Advanced_File_Server)
};
}
@@ -95,7 +97,7 @@ namespace 软件系统客户端Wpf.Views
}
//确认删除
OperateResultString result = fileClient.DeleteFile(UserClient.ServerIp, CommonLibrary.CommonLibrary.Port_Share_File, Hufile.FileName);
OperateResult result = fileClient.DeleteFile(Hufile.FileName);
if(result.IsSuccess)
{
MessageBox.Show("删除成功!");
@@ -126,7 +128,7 @@ namespace 软件系统客户端Wpf.Views
save_file_name += "\\" + Hufile.FileName;
OperateResultString result = fileClient.DownloadFile(UserClient.ServerIp, CommonLibrary.CommonLibrary.Port_Share_File, Hufile.FileName,
OperateResult result = fileClient.DownloadFile(Hufile.FileName,
(m, n) =>
{
Dispatcher.Invoke(new Action(() =>
@@ -155,6 +157,6 @@ namespace 软件系统客户端Wpf.Views
FileClient fileClient;
SimpleFileClient fileClient;
}
}

View File

@@ -60,6 +60,8 @@ namespace 软件系统服务端模版
{
public partial class FormServerWindow : Form
{
#region Constructor
public FormServerWindow()
{
InitializeComponent();
@@ -75,7 +77,7 @@ namespace 软件系统服务端模版
}
}
#endregion
#region +
@@ -210,7 +212,6 @@ namespace 软件系统服务端模版
Net_Simplify_Server_Initialization();//同步网络初始化
Net_Socket_Server_Initialization();//异步网络初始化
Net_SoftUpdate_Server_Initialization();//软件更新引擎初始化
Net_File_Update_Initialization();//软件异地更新引擎初始化
Simple_File_Initiaization();//共享文件引擎初始化
Net_File_Portrait_Initialization();//头像文件管理服务
Net_Udp_Server_Initialization();//UDP引擎服务初始化
@@ -355,29 +356,44 @@ namespace 软件系统服务端模版
#endregion
#region
#region
/**************************************************************************************
*
* 本文件管理器引擎目前主要实现3个大功能
* 1. 允许客户端上传服务器的客户端文件,用来提供软件自动更新使用的
* 2. 用于管理客户端的头像文件存储服务
* 3. 用于管理每个账户的私有文件存储服务
*
**************************************************************************************/
/// <summary>
/// 用于局域网异地更新服务器的客户端程序的引擎,仅限客户端
/// 一个高级的文件管理服务器引擎
/// </summary>
private AdvancedFileServer net_file_update = new AdvancedFileServer();
private AdvancedFileServer net_file_Advanced = new AdvancedFileServer();
/// <summary>
/// 软件异地更新的初始化,如不需要可以不启动,该功能支持发送客户端文件至服务器实现覆盖更新
/// 初始化高级的文件管理引擎
/// </summary>
private void Net_File_Update_Initialization()
private void Net_File_Portrait_Initialization()
{
try
{
net_file_update.FilesDirectoryPath = Application.StartupPath + @"\ClientFiles";//服务器客户端需要更新的路径,与上述一致
net_file_update.FilesDirectoryPathTemp= Application.StartupPath + @"\Temp";
net_file_update.LogNet = new LogNetSingle(LogSavePath + @"\update_file_log.txt");
net_file_update.KeyToken = CommonHeadCode.KeyToken;
net_file_update.ServerStart(CommonLibrary.CommonLibrary.Port_Update_Remote);
net_file_Advanced.FilesDirectoryPath = Application.StartupPath;
net_file_Advanced.FilesDirectoryPathTemp = Application.StartupPath + @"\Temp";
net_file_Advanced.LogNet = new LogNetSingle(LogSavePath + @"\Advanced_file_log.txt");
net_file_Advanced.KeyToken = CommonHeadCode.KeyToken;
net_file_Advanced.ServerStart(CommonLibrary.CommonLibrary.Port_Advanced_File_Server);
}
catch (Exception ex)
{
SoftBasic.ShowExceptionMessage(ex);
}
}
#endregion
#region
@@ -615,18 +631,6 @@ namespace 软件系统服务端模版
net_simplify_server.SendMessage(state, customer, "Y" + Convert.ToBase64String(System.IO.File.ReadAllBytes(fileName)));
}
}
else if (customer == CommonHeadCode.SimplifyHeadCode.)
{
string fileName = Application.StartupPath + @"\Files\Portrait\" + data + @"\" + PortraitSupport.LargePortrait;
if (string.IsNullOrEmpty(fileName))
{
net_simplify_server.SendMessage(state, customer, "N");
}
else
{
net_simplify_server.SendMessage(state, customer, "Y" + Convert.ToBase64String(System.IO.File.ReadAllBytes(fileName)));
}
}
else if (customer == CommonHeadCode.SimplifyHeadCode.)
{
try
@@ -776,13 +780,13 @@ namespace 软件系统服务端模版
}
else if (customer == CommonHeadCode.SimplifyHeadCode.)
{
LogNetSingle logNet = (LogNetSingle)net_file_Portrait.LogNet;
LogNetSingle logNet = (LogNetSingle)net_file_Advanced.LogNet;
net_simplify_server.SendMessage(state, 0, logNet.GetAllSavedLog());
RuntimeLogHelper.WriteInfo("头像日志查看");
}
else if (customer == CommonHeadCode.SimplifyHeadCode.)
{
if (net_file_Portrait.LogNet is LogNetSingle logNet)
if (net_file_Advanced.LogNet is LogNetSingle logNet)
{
logNet.ClearLog();
}
@@ -1358,33 +1362,7 @@ namespace 软件系统服务端模版
#endregion
#region
/// <summary>
/// 用于用户账户的头像文件保存
/// </summary>
private AdvancedFileServer net_file_Portrait = new AdvancedFileServer();
/// <summary>
/// 用户头像管理服务的引擎
/// </summary>
private void Net_File_Portrait_Initialization()
{
try
{
net_file_Portrait.FilesDirectoryPath = Application.StartupPath;
net_file_Portrait.FilesDirectoryPathTemp= Application.StartupPath + @"\Temp";
net_file_Portrait.LogNet =new LogNetSingle(LogSavePath + @"\Portrait_file_log.txt");
net_file_Portrait.KeyToken = CommonHeadCode.KeyToken;
net_file_Portrait.ServerStart(CommonLibrary.CommonLibrary.Port_Portrait_Server);
}
catch (Exception ex)
{
SoftBasic.ShowExceptionMessage(ex);
}
}
#endregion
}