Add files via upload

This commit is contained in:
Christopher
2020-12-16 22:41:21 +01:00
committed by GitHub
parent 0e09a90cae
commit 56f4190ad4
18 changed files with 5067 additions and 0 deletions
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings>
<setting name="font" serializeAs="String">
<value>Courier New, 8.25pt</value>
</setting>
<setting name="windowSize" serializeAs="String">
<value>612, 429</value>
</setting>
</Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings>
</userSettings>
</configuration>
+163
View File
@@ -0,0 +1,163 @@
namespace Narzędzie_diagnostyczne_karty_sieciowej
{
partial class Form1
{
/// <summary>
/// Wymagana zmienna projektanta.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Wyczyść wszystkie używane zasoby.
/// </summary>
/// <param name="disposing">prawda, jeżeli zarządzane zasoby powinny zostać zlikwidowane; Fałsz w przeciwnym wypadku.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Kod generowany przez Projektanta formularzy systemu Windows
/// <summary>
/// Metoda wymagana do obsługi projektanta — nie należy modyfikować
/// jej zawartości w edytorze kodu.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.textBox1 = new System.Windows.Forms.TextBox();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.zarzadzanieToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.generujPlikTekstowyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.odświeżInformacjeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.czcionkaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fontDialog1 = new System.Windows.Forms.FontDialog();
this.opcjeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.wkrótceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.textBox1.Location = new System.Drawing.Point(0, 24);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(596, 366);
this.textBox1.TabIndex = 2;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.zarzadzanieToolStripMenuItem,
this.czcionkaToolStripMenuItem,
this.opcjeToolStripMenuItem,
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(596, 24);
this.menuStrip1.TabIndex = 4;
this.menuStrip1.Text = "menuStrip1";
//
// zarzadzanieToolStripMenuItem
//
this.zarzadzanieToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.generujPlikTekstowyToolStripMenuItem,
this.odświeżInformacjeToolStripMenuItem});
this.zarzadzanieToolStripMenuItem.Name = "zarzadzanieToolStripMenuItem";
this.zarzadzanieToolStripMenuItem.Size = new System.Drawing.Size(81, 20);
this.zarzadzanieToolStripMenuItem.Text = "Zarządzanie";
//
// generujPlikTekstowyToolStripMenuItem
//
this.generujPlikTekstowyToolStripMenuItem.Name = "generujPlikTekstowyToolStripMenuItem";
this.generujPlikTekstowyToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.generujPlikTekstowyToolStripMenuItem.Text = "Generuj plik tekstowy";
this.generujPlikTekstowyToolStripMenuItem.Click += new System.EventHandler(this.generate);
//
// odświeżInformacjeToolStripMenuItem
//
this.odświeżInformacjeToolStripMenuItem.Name = "odświeżInformacjeToolStripMenuItem";
this.odświeżInformacjeToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.odświeżInformacjeToolStripMenuItem.Text = "Odśwież informacje";
this.odświeżInformacjeToolStripMenuItem.Click += new System.EventHandler(this.refresh);
//
// czcionkaToolStripMenuItem
//
this.czcionkaToolStripMenuItem.Name = "czcionkaToolStripMenuItem";
this.czcionkaToolStripMenuItem.Size = new System.Drawing.Size(67, 20);
this.czcionkaToolStripMenuItem.Text = "Czcionka";
this.czcionkaToolStripMenuItem.Click += new System.EventHandler(this.changeFont);
//
// fontDialog1
//
this.fontDialog1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
//
// opcjeToolStripMenuItem
//
this.opcjeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.wkrótceToolStripMenuItem});
this.opcjeToolStripMenuItem.Name = "opcjeToolStripMenuItem";
this.opcjeToolStripMenuItem.Size = new System.Drawing.Size(50, 20);
this.opcjeToolStripMenuItem.Text = "Opcje";
//
// wkrótceToolStripMenuItem
//
this.wkrótceToolStripMenuItem.Enabled = false;
this.wkrótceToolStripMenuItem.Name = "wkrótceToolStripMenuItem";
this.wkrótceToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.wkrótceToolStripMenuItem.Text = "Wkrótce";
//
// stworzonePrzezKrzysiekSiemvToolStripMenuItem
//
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem.Name = "stworzonePrzezKrzysiekSiemvToolStripMenuItem";
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem.Size = new System.Drawing.Size(181, 20);
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem.Text = "Stworzone przez KrzysiekSiemv";
this.stworzonePrzezKrzysiekSiemvToolStripMenuItem.Click += new System.EventHandler(this.stworzonePrzezKrzysiekSiemvToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(596, 390);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "NetworkInterfaces Diagnostic";
this.Load += new System.EventHandler(this.onLoad);
this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem zarzadzanieToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem generujPlikTekstowyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem odświeżInformacjeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem czcionkaToolStripMenuItem;
private System.Windows.Forms.FontDialog fontDialog1;
private System.Windows.Forms.ToolStripMenuItem opcjeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem wkrótceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem stworzonePrzezKrzysiekSiemvToolStripMenuItem;
}
}
@@ -0,0 +1,132 @@
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 System.Net;
using System.IO;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Diagnostics;
namespace Narzędzie_diagnostyczne_karty_sieciowej
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void showInformation()
{
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
textBox1.Text = ("Informacje o ustawieniach karty sieciowej dla urządzenia \"" + properties.HostName + "\"" + Environment.NewLine + Environment.NewLine);
foreach (NetworkInterface adapter in networkInterfaces)
{
textBox1.Text += adapter.Description + Environment.NewLine;
textBox1.Text += (String.Empty.PadLeft(adapter.Description.Length, '=')) + Environment.NewLine;
IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
GatewayIPAddressInformationCollection addressInformation = adapterProperties.GatewayAddresses;
IPv4InterfaceProperties ip = adapterProperties.GetIPv4Properties();
IPAddressCollection dnsServer = adapterProperties.DnsAddresses;
IPAddressCollection dhcpServer = adapterProperties.DhcpServerAddresses;
if (ip == null)
textBox1.Text += "Nie ma informacji na temat tej karty sieciowej";
else
{
// Typ interfejsu
textBox1.Text += ("Typ interfejsu ........... : " + adapter.NetworkInterfaceType + Environment.NewLine);
// Adres IPv4 i IPv6
foreach (UnicastIPAddressInformation ipaddress in adapterProperties.UnicastAddresses)
{
if (ipaddress.Address.AddressFamily == AddressFamily.InterNetworkV6)
textBox1.Text += ("Adres IPv6 ............... : " + ipaddress.Address + Environment.NewLine);
if (ipaddress.Address.AddressFamily == AddressFamily.InterNetwork)
textBox1.Text += ("Adres IPv4 ............... : " + ipaddress.Address + Environment.NewLine);
}
foreach (GatewayIPAddressInformation address in addressInformation)
textBox1.Text += ("Brama domyślna ........... : " + address.Address + Environment.NewLine);
textBox1.Text += ("Adres fizyczny (MAC) ..... : " + adapter.GetPhysicalAddress() + Environment.NewLine);
if(dhcpServer.Count > 0)
{
foreach (IPAddress dhcp in dhcpServer)
textBox1.Text += ("Serwer DHCP .............. : " + dhcp + Environment.NewLine);
}
else
textBox1.Text += ("Serwer DHCP .............. : wyłączony" + Environment.NewLine);
textBox1.Text += ("Serwery DNS .............. : " + Environment.NewLine);
foreach (IPAddress dns in dnsServer)
textBox1.Text += (" " + dns + Environment.NewLine);
textBox1.Text += Environment.NewLine;
}
}
}
private void onLoad(object sender, EventArgs e)
{
showInformation();
textBox1.Font = Properties.Settings.Default.font;
this.Size = Properties.Settings.Default.windowSize;
}
// NIE DOTYKAĆ, BO DZIAŁA
private void generate(object sender, EventArgs e)
{
saveFileDialog1.Filter = "Plik tekstowy (*.txt)|*.txt|Wszystkie pliki (*.*)|*.*";
saveFileDialog1.FilterIndex = 1;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
TextWriter txt = new StreamWriter(saveFileDialog1.FileName);
txt.Write(textBox1.Text);
txt.Close();
}
}
private void refresh(object sender, EventArgs e)
{
showInformation();
}
// NIE DOTYKAĆ, BO DZIAŁA
private void changeFont(object sender, EventArgs e)
{
if(fontDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Font = fontDialog1.Font;
Properties.Settings.Default.font = fontDialog1.Font;
Properties.Settings.Default.Save();
MessageBox.Show("Twoja nowa czcionka: " + fontDialog1.Font.Name + ", " + fontDialog1.Font.Size + "pt. Została zapisana", "Ustawienie");
}
}
// NIE DOTYKAĆ, BO DZIAŁA
private void Form1_SizeChanged(object sender, EventArgs e)
{
Properties.Settings.Default.windowSize = this.Size;
Properties.Settings.Default.Save();
}
private void stworzonePrzezKrzysiekSiemvToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/KrzysiekSiemv");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{95B9449A-F2A1-43CC-8A80-E078E5C9DE78}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Narzędzie_diagnostyczne_karty_sieciowej</RootNamespace>
<AssemblyName>Narzędzie diagnostyczne karty sieciowej</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings>
<setting name="font" serializeAs="String">
<value>Courier New, 8.25pt</value>
</setting>
<setting name="windowSize" serializeAs="String">
<value>612, 429</value>
</setting>
</Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings>
</userSettings>
</configuration>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings>
<setting name="font" serializeAs="String">
<value>Courier New, 8.25pt</value>
</setting>
<setting name="windowSize" serializeAs="String">
<value>612, 429</value>
</setting>
</Narzędzie_diagnostyczne_karty_sieciowej.Properties.Settings>
</userSettings>
</configuration>
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB