91 lines
2.4 KiB
C#
91 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using Net;
|
|
|
|
namespace FileSend
|
|
{
|
|
public enum FileSendType
|
|
{
|
|
Server,
|
|
Client
|
|
}
|
|
|
|
public partial class Setting : Form
|
|
{
|
|
public Setting()
|
|
{
|
|
InitializeComponent();
|
|
textBox_RootPath_Server.Text = NetHelper.ServerRootPath;
|
|
checkBox_SavePath_Client.Checked = NetHelper.IsSaveServerIP;
|
|
checkBox_ShowLog_Client.Checked = NetHelper.IsShowLog;
|
|
}
|
|
|
|
protected override void OnClosed(EventArgs e)
|
|
{
|
|
base.OnClosed(e);
|
|
}
|
|
|
|
void Choose(int index)
|
|
{
|
|
// None
|
|
|
|
// Server
|
|
label_RootPath_Server.Visible = false;
|
|
button_Choose_Server.Visible = false;
|
|
textBox_RootPath_Server.Visible = false;
|
|
// Client
|
|
checkBox_SavePath_Client.Visible = false;
|
|
checkBox_ShowLog_Client.Visible = false;
|
|
|
|
if (index == 0)
|
|
{
|
|
// None
|
|
}
|
|
else if (index == 1)
|
|
{
|
|
// Server
|
|
label_RootPath_Server.Visible = true;
|
|
button_Choose_Server.Visible = true;
|
|
textBox_RootPath_Server.Visible = true;
|
|
}
|
|
else if (index == 2)
|
|
{
|
|
// Client
|
|
checkBox_SavePath_Client.Visible = true;
|
|
checkBox_ShowLog_Client.Visible = true;
|
|
}
|
|
}
|
|
|
|
private void button1_General_Click(object sender, EventArgs e)
|
|
{
|
|
Choose(0);
|
|
}
|
|
|
|
private void button_Choose_Server_Click(object sender, EventArgs e)
|
|
{
|
|
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
|
|
folderBrowserDialog.ShowDialog();
|
|
if (!string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
|
|
{
|
|
textBox_RootPath_Server.Text = folderBrowserDialog.SelectedPath;
|
|
}
|
|
}
|
|
|
|
private void button_Server_Click(object sender, EventArgs e)
|
|
{
|
|
Choose(1);
|
|
}
|
|
|
|
private void button_Client_Click(object sender, EventArgs e)
|
|
{
|
|
Choose(2);
|
|
}
|
|
}
|
|
} |