添加项目
parent
8eb8f56118
commit
e92a101498
@ -0,0 +1,9 @@
|
||||
<Application x:Class="SocketStudy.ClientApp.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SocketStudy.ClientApp"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
@ -0,0 +1,34 @@
|
||||
<Window x:Class="SocketStudy.ClientApp.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:SocketStudy.ClientApp"
|
||||
mc:Ignorable="d"
|
||||
Title=" 客户端" Height="677" Width="800" Icon="/Images/logo.ico" ResizeMode="CanMinimize">
|
||||
<Grid Margin="0,0,0,74">
|
||||
<TextBox x:Name="textBox_ServerAddress" HorizontalAlignment="Left" Margin="180,24,0,0" TextWrapping="Wrap" Text="192.168.1.66" VerticalAlignment="Top" Width="190" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<Label x:Name="lable_address_title" Content="远程服务器地址:" HorizontalAlignment="Left" Margin="25,24,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="150" BorderThickness="2,2,2,2" Grid.ColumnSpan="2"/>
|
||||
<Label x:Name="lable_server_port_title" Content="远程服务端口号:" HorizontalAlignment="Left" Margin="517,24,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="150" BorderThickness="2,2,2,2"/>
|
||||
<TextBox x:Name="textBox_ServerPort" HorizontalAlignment="Left" Margin="675,24,0,0" TextWrapping="Wrap" Text="6601" VerticalAlignment="Top" Width="87" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<RichTextBox x:Name="richTextBox_Log" Margin="25,342,35,-51" FontSize="14" VerticalScrollBarVisibility="Auto">
|
||||
<FlowDocument>
|
||||
<Paragraph>
|
||||
<Run Text=""/>
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</RichTextBox>
|
||||
<Label x:Name="lable_SendData_Title" Content="发送数据:" HorizontalAlignment="Left" Margin="25,260,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="101" BorderThickness="2,2,2,2"/>
|
||||
<TextBox x:Name="textBox_SendData" HorizontalAlignment="Left" Margin="25,260,0,0" TextWrapping="Wrap" Text="你好,我是来自客户端的数据!" VerticalAlignment="Top" Width="562" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Left"/>
|
||||
<Button x:Name="btn_Connect" Content="连接服务器" HorizontalAlignment="Left" Margin="25,169,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" Click="btn_Connect_Click"/>
|
||||
<Button x:Name="btn_Close" Content="关闭连接" HorizontalAlignment="Left" Margin="248,169,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" RenderTransformOrigin="1.482,0.633" Click="btn_Close_Click"/>
|
||||
<Button x:Name="btn_Send" Content="发送数据" HorizontalAlignment="Left" Margin="640,261,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" RenderTransformOrigin="1.482,0.633" Click="btn_Send_Click"/>
|
||||
<Label x:Name="lable_client_port_title" Content="本地连接端口号:" HorizontalAlignment="Left" Margin="517,95,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="150" BorderThickness="2,2,2,2"/>
|
||||
<TextBox x:Name="textBox_ClientPort" HorizontalAlignment="Left" Margin="674,95,0,0" TextWrapping="Wrap" Text="6901" VerticalAlignment="Top" Width="88" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<Button x:Name="btn_Dispose" Content="释放连接" HorizontalAlignment="Left" Margin="465,169,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" RenderTransformOrigin="1.482,0.633" Click="btn_Dispose_Click"/>
|
||||
<TextBox x:Name="textBox_ClientAddress" HorizontalAlignment="Left" Margin="180,95,0,0" TextWrapping="Wrap" Text="192.168.1.66" VerticalAlignment="Top" Width="190" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<Label x:Name="lable_client_address_title" Content="本地连接地址:" HorizontalAlignment="Left" Margin="25,95,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="150" BorderThickness="2,2,2,2" RenderTransformOrigin="-0.139,0.451"/>
|
||||
<Button x:Name="btn_Back" Content="备用按钮" HorizontalAlignment="Left" Margin="640,169,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" RenderTransformOrigin="1.482,0.633" />
|
||||
|
||||
</Grid>
|
||||
</Window>
|
@ -0,0 +1,9 @@
|
||||
<Application x:Class="SocketStudy.ServerApp.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SocketStudy.ServerApp"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
@ -0,0 +1,29 @@
|
||||
<Window x:Class="SocketStudy.ServerApp.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:SocketStudy.ServerApp"
|
||||
mc:Ignorable="d"
|
||||
Title=" 服务器" Height="593" Width="800" Icon="/Images/logo.ico" ContentRendered="Window_ContentRendered">
|
||||
<Grid>
|
||||
<Label x:Name="lable_address_title" Content="服务地址:" HorizontalAlignment="Left" Margin="20,24,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="101" BorderThickness="2,2,2,2"/>
|
||||
<Label x:Name="lable_port_title" Content="端口号:" HorizontalAlignment="Left" Margin="311,24,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="79" BorderThickness="2,2,2,2"/>
|
||||
<TextBox x:Name="textBox_ServerPort" HorizontalAlignment="Left" Margin="390,25,0,0" TextWrapping="Wrap" Text="6601" VerticalAlignment="Top" Width="86" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<RichTextBox x:Name="richTextBox_Log" Margin="30,170,30,23" FontSize="14" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Auto">
|
||||
<FlowDocument>
|
||||
<Paragraph>
|
||||
<Run Text=""/>
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</RichTextBox>
|
||||
<Label x:Name="lable_SendData_Title" Content="发送数据:" HorizontalAlignment="Left" Margin="20,97,0,0" VerticalAlignment="Top" Height="45" FontSize="18" VerticalContentAlignment="Center" Width="101" BorderThickness="2,2,2,2"/>
|
||||
<TextBox x:Name="textBox_SendData" HorizontalAlignment="Left" Margin="121,97,0,0" TextWrapping="Wrap" Text="你好,我是远程服务器数据!" VerticalAlignment="Top" Width="253" FontSize="18" Height="45" VerticalContentAlignment="Center" Padding="5,5,5,5" FontWeight="Bold" HorizontalContentAlignment="Left"/>
|
||||
<Button x:Name="btn_Start" Content="启动服务" HorizontalAlignment="Left" Margin="499,25,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" Click="btn_Start_Click"/>
|
||||
<Button x:Name="btn_Stop" Content="停止服务" HorizontalAlignment="Left" Margin="643,24,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" RenderTransformOrigin="1.482,0.633" Click="btn_Stop_Click"/>
|
||||
<Button x:Name="btn_Send" Content="发送数据" HorizontalAlignment="Left" Margin="643,97,0,0" VerticalAlignment="Top" Height="45" Width="122" FontSize="18" RenderTransformOrigin="1.482,0.633" Click="btn_Send_Click"/>
|
||||
<ComboBox x:Name="comboBox_Clients" HorizontalAlignment="Left" Margin="390,97,0,0" VerticalAlignment="Top" Width="231" Height="45" FontSize="18" HorizontalContentAlignment="Left" VerticalContentAlignment="Center"/>
|
||||
<ComboBox x:Name="comboBox_ServerAddress" HorizontalAlignment="Left" Margin="121,25,0,0" VerticalAlignment="Top" Width="185" Height="45" FontSize="18" HorizontalContentAlignment="Left" VerticalContentAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,8 @@
|
||||
global using Xunit;
|
||||
global using System.Net;
|
||||
global using System.Net.Sockets;
|
||||
global using System.IO;
|
||||
global using System.Net.Cache;
|
||||
global using System.Net.Mime;
|
||||
global using System.Net.NetworkInformation;
|
||||
global using System.Net.Security;
|
Loading…
Reference in New Issue