Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="GetWMIBasic.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GetWMIBasic"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
11 changes: 11 additions & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Windows;

namespace GetWMIBasic
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
54 changes: 54 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Community Guidelines

At TheFlightSims, we recognize and celebrate the creativity and collaboration of open
source contributors and the diversity of skills, experiences, cultures, and
opinions they bring to the projects and communities they participate in.

Every one of the communities is an inclusive environment, based on treating
all individuals respectfully, regardless of
gender identity and expression, sexual orientation, and disabilities,
neurodiversity, physical appearance, body size, ethnicity, nationality, race,
age, religion, or similar personal characteristics.

We value diverse opinions, but we value respectful behavior more.

Respectful behavior includes:

* Being considerate, kind, constructive, and helpful.
* Not engaging in demeaning, discriminatory, harassing, hateful, sexualized, or
physically threatening behavior, speech, and imagery.
* Not engaging in unwanted physical contact.

Some of TheFlightSims' open-source projects may adopt an explicit project code of
conduct, which may have additional detailed expectations for participants. Most
of those projects will use our modified Contributor Covenant.

## Resolve peacefully

We do not believe that all conflict is necessarily bad; healthy debate and
disagreement often yield positive results. However, it is never okay to be
disrespectful.

If you see someone behaving disrespectfully, you are encouraged to address the
behavior directly with those involved. Many issues can be resolved quickly and
easily, and this gives people more control over the outcome of their disputes.
If you are unable to resolve the matter for any reason, or if the behavior is
threatening or harassing, report it. We are dedicated to providing an
environment where participants feel welcome and safe.

## Reporting problems

Some of TheFlightSims' open-source projects may adopt a project-specific code of conduct.
In those cases, a TheFlightSims employee will be identified as the Project Steward,
who will receive and handle reports of code of conduct violations. If a project hasn’t identified a Project Steward, you can report problems by
emailing mailto:report_concern@theflightsims.com

We will investigate every complaint, but you may not receive a direct response.
We will use our discretion in determining when and how to follow up on reported
incidents, which may range from not taking action to permanent expulsion from
the project and project-sponsored spaces. We will notify the accused of the
report and provide them an opportunity to discuss it before any action is
taken. The identity of the reporter will be omitted from the details of the
report supplied to the accused. In potentially harmful situations, such as
ongoing harassment or threats to anyone's safety, we may take action without
notice.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contributing

## Environment requirements

### Git repo

To clone the repo, run, use this command

```bash
git clone https://github.com/tfslabs/get-wmi-basic.git
```

### Build with Visual Studio (only for Windows)

To contribute, you may need Visual Studio 2022. Required Visual Studio 2022 SDKs:

* .NET 4.8 SDK and targeting pack
* Windows 10 SDK (10.0.18362.0) (if applicable)

## Build from source

You can open the `Get WMI Basic.csproj` to open the project in Visual Studio

However, since this project is a part of [Windows Server Management Tool](https://github.com/TheFlightSims/windowsserver-mgmttools), you may need to clone the whole repo, before using Visual Studio, because the full Visual Studio Solution are already configured with valid build configurations.
61 changes: 61 additions & 0 deletions ConnectForm.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<Window x:Class="GetWMIBasic.ConnectForm"
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:GetWMIBasic"
mc:Ignorable="d"
Title="Connect To Another Computer"
Height="160"
Width="400" ResizeMode="NoResize"
SizeToContent="WidthAndHeight">
<Grid Width="400">
<Grid.Margin>
<Thickness Bottom="5" Top="2"></Thickness>
</Grid.Margin>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="10,0,10,0">
<Label VerticalAlignment="Center">Connect to another computer using domain or IP</Label>
</Grid>
<Grid Grid.Row="1" Margin="10,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="260"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" VerticalAlignment="Center">Computer Name</Label>
<TextBox x:Name="ComputerName_TextBox" Grid.Column="1" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="2" Margin="10,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="260"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" VerticalAlignment="Center">User Name</Label>
<TextBox x:Name="UserName_TextBox" Grid.Column="1" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="3" Margin="10,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="260"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" VerticalAlignment="Center">Password</Label>
<PasswordBox x:Name="Password_TextBox" Grid.Column="1" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="4" Margin="10,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="90"/>
</Grid.ColumnDefinitions>
<Button Margin="0,0,5,0" Grid.Column="0" VerticalAlignment="Center" Click="ConnetToExternal_Button">Connect</Button>
<Button Margin="5,0,5,0" Grid.Column="1" VerticalAlignment="Center" Click="ConnectToLocal_Button">Connect to Local Computer</Button>
<Button Margin="5,0,0,0" Grid.Column="2" VerticalAlignment="Center" Click="Cancel_Button">Cancel</Button>
</Grid>
</Grid>
</Window>
71 changes: 71 additions & 0 deletions ConnectForm.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System.Security;
using System.Windows;

namespace GetWMIBasic
{
public partial class ConnectForm : Window
{
/*
* Global properties
*/
private bool isConnectLocally;

public ConnectForm()
{
isConnectLocally = false;
InitializeComponent();
}

/*
* Button-based methods
*/

private void ConnetToExternal_Button(object sender, RoutedEventArgs e)
{
if (
ComputerName_TextBox.Text.Length == 0 ||
UserName_TextBox.Text.Length == 0 ||
Password_TextBox.Password.Length == 0)
{
MessageBox.Show("Please don't leave anything empty", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
}
else
{
DialogResult = true;
}
}

private void ConnectToLocal_Button(object sender, RoutedEventArgs e)
{
isConnectLocally = true;
DialogResult = true;
}

private void Cancel_Button(object sender, RoutedEventArgs e)
{
Close();
}

/*
* Non-button methods
*/
public (string, string, SecureString) ReturnValue()
{
ShowDialog();

string computerName = (isConnectLocally) ? "localhost" : ComputerName_TextBox.Text;
string userName = (isConnectLocally) ? "" : UserName_TextBox.Text;
SecureString password = new SecureString();

if (!isConnectLocally)
{
foreach (char c in Password_TextBox.Password)
{
password.AppendChar(c);
}
}

return (computerName, userName, password);
}
}
}
Loading