Compare commits

...

15 Commits
v1.0 ... master

Author SHA1 Message Date
J. Fronny 9301859691 Update .gitlab-ci.yml 2020-08-31 19:20:21 +00:00
J. Fronny ff93bd23e9 Update .gitlab-ci.yml 2020-07-31 13:35:41 +00:00
J. Fronny 7327f47e0c Add LICENSE 2020-06-27 16:22:47 +00:00
J. Fronny e33b004d2d Merge branch 'renovate/configure' into 'master'
Configure Renovate

See merge request JFronny/WinPart!1
2020-06-23 12:08:12 +00:00
Renovate Bot ae465be295
Add renovate.json 2020-06-23 08:46:52 +00:00
J. Fronny 481abe6385 Delete main.yml 2020-06-18 15:22:06 +00:00
J. Fronny a702c29831 Update README.md 2020-06-18 15:17:22 +00:00
J. Fronny 13704cbbfd Add .gitlab-ci.yml 2020-06-18 15:16:13 +00:00
J. Fronny 256cf55619
Update main.yml 2020-04-02 15:42:57 +02:00
J. Fronny 1ce9dee81e
Update README.md 2020-03-24 15:45:41 +01:00
J. Fronny 6861d7d9a4
Fix MainFile in main.yml 2020-03-16 20:33:17 +01:00
J. Fronny 503d47f19c
Add automatic builds 2020-03-16 20:28:17 +01:00
CreepyCrafter24 a4cd8537f6 batchscript in package 2020-03-16 20:27:21 +01:00
CreepyCrafter24 731a2dff4b Cool stuffs 2020-03-16 20:05:44 +01:00
CreepyCrafter24 a44b6ccbd4 Improved code 2019-11-09 23:29:23 +01:00
20 changed files with 375 additions and 446 deletions

48
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,48 @@
.shared_windows_runners:
tags:
- windows
image: mcr.microsoft.com/dotnet/core/sdk
uptool:
extends:
- .shared_windows_runners
stage: deploy
script: |
mkdir i
cd i
$(new-object System.Net.WebClient).DownloadFile("https://gitlab.com/JFronny/UpTool2/-/jobs/artifacts/master/raw/Installer-generic.zip?job=uptool", "$($(pwd).Path)\Install.zip")
& "C:\Program Files\7-Zip\7z.exe" x .\Install.zip
.\Installer.exe --basic i -p
cd ..
rm -R i
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Install"
uptool --basic add-repo DevTools https://gitlab.com/JFronny/UpTool2/-/snippets/2010392/raw
uptool --basic update
uptool --basic install "UpTool2 package tools"
$Env:Path="$Env:Path;$Env:APPDATA\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app"
mkdir .\build
dotnet publish -o .\build -c Release
$file = Get-Item $(Resolve-Path .\build\*.exe).Path
pkgtool build --binDir build --mainBin $file --packageFile .\package.zip --noLogo
$asm = $([Reflection.Assembly]::LoadFile($file.DirectoryName + "\" + $file.BaseName + ".dll"))
$asmver = $asm.GetName().Version.ToString()
[System.XML.XMLDocument]$xml=New-Object System.XML.XMLDocument
[System.XML.XMLElement]$app=$xml.CreateElement("app")
$xml.appendChild($app)
$app.appendChild($xml.CreateElement("Name")).InnerText = $asm.GetName().Name
$app.appendChild($xml.CreateElement("Description")).InnerText = "View information about your (logical) partitions"
$app.appendChild($xml.CreateElement("Version")).InnerText = $asmver
$app.appendChild($xml.CreateElement("ID")).InnerText = "a48b0879-42ec-40e1-885a-480e948242d7"
$app.appendChild($xml.CreateElement("File")).InnerText = $CI_PROJECT_URL + "/-/jobs/" + $CI_JOB_ID + "/artifacts/raw/package.zip"
$app.appendChild($xml.CreateElement("Hash")).InnerText = $(Get-FileHash .\package.zip).Hash
$app.appendChild($xml.CreateElement("MainFile")).InnerText = $file.Name
echo NULL > app.xml
$xml.save($(gi .\app.xml).Fullname)
artifacts:
paths:
- package.zip
- app.xml
only:
- master

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 J. Fronny
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1 +1,2 @@
# WinPart
[![UpTool2](https://img.shields.io/badge/Get%20it-on%20UpTool2-blue)](https://jfronny.gitlab.io/home/uptool)

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,111 +0,0 @@
using System;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
namespace CommandLine.Utility
{
/// <summary>
/// Arguments class
/// </summary>
public class Arguments
{
// Variables
private StringDictionary Parameters;
// Constructor
public Arguments(string[] Args)
{
Parameters = new StringDictionary();
Regex Spliter = new Regex(@"^-{1,2}|^/|=|:",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
Regex Remover = new Regex(@"^['""]?(.*?)['""]?$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
string Parameter = null;
string[] Parts;
// Valid parameters forms:
// {-,/,--}param{ ,=,:}((",')value(",'))
// Examples:
// -param1 value1 --param2 /param3:"Test-:-work"
// /param4=happy -param5 '--=nice=--'
foreach (string Txt in Args)
{
// Look for new parameters (-,/ or --) and a
// possible enclosed value (=,:)
Parts = Spliter.Split(Txt, 3);
switch (Parts.Length)
{
// Found a value (for the last parameter
// found (space separator))
case 1:
if (Parameter != null)
{
if (!Parameters.ContainsKey(Parameter))
{
Parts[0] =
Remover.Replace(Parts[0], "$1");
Parameters.Add(Parameter, Parts[0]);
}
Parameter = null;
}
// else Error: no parameter waiting for a value (skipped)
break;
// Found just a parameter
case 2:
// The last parameter is still waiting.
// With no value, set it to true.
if (Parameter != null)
{
if (!Parameters.ContainsKey(Parameter))
Parameters.Add(Parameter, "true");
}
Parameter = Parts[1];
break;
// Parameter with enclosed value
case 3:
// The last parameter is still waiting.
// With no value, set it to true.
if (Parameter != null)
{
if (!Parameters.ContainsKey(Parameter))
Parameters.Add(Parameter, "true");
}
Parameter = Parts[1];
// Remove possible enclosing characters (",')
if (!Parameters.ContainsKey(Parameter))
{
Parts[2] = Remover.Replace(Parts[2], "$1");
Parameters.Add(Parameter, Parts[2]);
}
Parameter = null;
break;
}
}
// In case a parameter is still waiting
if (Parameter != null)
{
if (!Parameters.ContainsKey(Parameter))
Parameters.Add(Parameter, "true");
}
}
// Retrieve a parameter value if it exists
// (overriding C# indexer property)
public string this[string Param]
{
get
{
return (Parameters[Param]);
}
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Management;
using WinPart.Properties;
namespace WinPart.Data_structure
{
internal class Device
{
private ManagementBaseObject _mo;
public string Name;
public List<Partition> Partitions;
public Device GetFromMo(ManagementObject mo)
{
_mo = mo;
Partitions = new List<Partition>();
foreach (ManagementObject m in new ManagementObjectSearcher(
$"associators of {{{mo.Path.RelativePath}}} where AssocClass = Win32_DiskDriveToDiskPartition").Get())
Partitions.Add(new Partition().GetFromMo(m));
Name = (string) mo.Properties["Model"].Value;
return this;
}
public void GetInfo()
{
foreach (string s in Resources.Device.Split(new[] {"\r\n"}, StringSplitOptions.None))
Program.PrintInfo(_mo, s);
}
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Management;
using WinPart.Properties;
namespace WinPart.Data_structure
{
internal class LogicalDrive
{
private ManagementBaseObject _mo;
public string Name;
public LogicalDrive GetFromMo(ManagementBaseObject mo)
{
Name = (string) mo.Properties["Name"].Value;
_mo = mo;
return this;
}
public void GetInfo()
{
foreach (string s in Resources.LogicalDrive.Split(new[] {"\r\n"}, StringSplitOptions.None))
Program.PrintInfo(_mo, s);
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Management;
using WinPart.Properties;
namespace WinPart.Data_structure
{
internal class Partition
{
private ManagementBaseObject _mo;
public List<LogicalDrive> LogicalDrives;
public string Name;
public Partition GetFromMo(ManagementObject mo)
{
_mo = mo;
LogicalDrives = new List<LogicalDrive>();
foreach (ManagementBaseObject m in new ManagementObjectSearcher(
$"associators of {{{mo.Path.RelativePath}}} where AssocClass = Win32_LogicalDiskToPartition").Get())
LogicalDrives.Add(new LogicalDrive().GetFromMo(m));
Name = (string) mo.Properties["Type"].Value;
return this;
}
public void GetInfo()
{
foreach (string s in Resources.Partition.Split(new[] {"\r\n"}, StringSplitOptions.None))
Program.PrintInfo(_mo, s);
}
}
}

View File

@ -1,69 +1,92 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management;
using CommandLine.Utility;
using WinPart.Properties;
using System.Collections;
#pragma warning disable IDE1006
namespace WinPart {
class Program {
List<Device> drives;
bool longInputSupport, debug;
static void Main(string[] args) => new Program().main(new Arguments(args));
void main(Arguments args) {
longInputSupport = args["li"] != null;
debug = args["debug"] != null;
using WinPart.Data_structure;
using static System.Environment;
namespace WinPart
{
internal static class Program
{
private static List<Device> _drives;
private static bool _longInputSupport, _debug;
private static void Main(string[] args)
{
List<string> li = new List<string>(args.Select(s =>
{
if (s.StartsWith("-") || s.StartsWith("/"))
s = s.Remove(0, 1);
return s;
}));
_longInputSupport = li.Contains("li");
_debug = li.Contains("debug");
bool run = true;
if ((args["help"] != null) || (args["?"] != null)) {
Console.WriteLine("WinPart is a tool for manipulating storage.\r\n\r\nWinPart [-li] [-help] [-debug]\r\n\r\nli Enables large inputs (over 1 char)\r\nhelp Shows this message\r\ndebug Troubleshooting");
if (li.Contains("help") || li.Contains("?"))
{
Console.WriteLine(@"WinPart is a tool for manipulating storage.
WinPart [-li] [-help] [-debug]
li Enables large inputs (over 1 char)
help Shows this message
debug Troubleshooting");
run = false;
}
if (run)
mainWindow();
}
void mainWindow() {
if (!run) return;
Console.WriteLine("Use \"WinPart -help\" for CMD Args");
Console.WriteLine("Welcome to WinPart. Choose one of the disks by their number to continue.");
try {
drives = new List<Device>() { };
try
{
_drives = new List<Device>();
int i = 0;
foreach (ManagementObject mo in new ManagementObjectSearcher("select * from Win32_DiskDrive").Get()) {
foreach (ManagementObject mo in new ManagementObjectSearcher("select * from Win32_DiskDrive").Get())
{
i++;
drives.Add(new Device().getFromMO(mo, this));
Console.WriteLine(i.ToString() + ": " + drives[drives.Count - 1].name);
_drives.Add(new Device().GetFromMo(mo));
Console.WriteLine($"{i}: {_drives[^1].Name}");
}
Device drive = drives[int.Parse(getInput()) - 1];
Console.WriteLine("Choose one of the operations by their number to continue.\r\n1: Info\r\n2: Open");
switch (int.Parse(getInput())) {
Device drive = _drives[int.Parse(GetInput()) - 1];
Console.WriteLine(@"Choose one of the operations by their number to continue.
1: Info
2: Open");
switch (int.Parse(GetInput()))
{
case 1:
drive.getInfo();
drive.GetInfo();
break;
case 2:
Console.WriteLine("Processing...\r\nChoose one of the partitions by their number to continue.");
for (i = 0; i < drive.partitions.Count; i++)
Console.WriteLine((i + 1).ToString() + ": " + drive.partitions[i].name);
Partition partition = drive.partitions[int.Parse(getInput()) - 1];
Console.WriteLine("Choose one of the operations by their number to continue.\r\n1: Info\r\n2: Open");
switch (int.Parse(getInput())) {
Console.WriteLine(@"Processing...
Choose one of the partitions by their number to continue.");
for (i = 0; i < drive.Partitions.Count; i++)
Console.WriteLine($"{i + 1}: {drive.Partitions[i].Name}");
Partition partition = drive.Partitions[int.Parse(GetInput()) - 1];
Console.WriteLine(@"Choose one of the operations by their number to continue.
1: Info
2: Open");
switch (int.Parse(GetInput()))
{
case 1:
partition.getInfo();
partition.GetInfo();
break;
case 2:
Console.WriteLine("Processing...\r\nChoose one of the logical drives by their number to continue.");
for (i = 0; i < partition.logicalDrives.Count; i++)
Console.WriteLine((i + 1).ToString() + ": " + partition.logicalDrives[i].name);
LogicalDrive logicalDrive = partition.logicalDrives[int.Parse(getInput()) - 1];
Console.WriteLine("Choose one of the operations by their number to continue.\r\n1: Info\r\n2: Explorer");
switch (int.Parse(getInput())) {
Console.WriteLine(@"Processing...
Choose one of the logical drives by their number to continue.");
for (i = 0; i < partition.LogicalDrives.Count; i++)
Console.WriteLine($"{i + 1}: {partition.LogicalDrives[i].Name}");
LogicalDrive logicalDrive = partition.LogicalDrives[int.Parse(GetInput()) - 1];
Console.WriteLine(@"Choose one of the operations by their number to continue.
1: Info
2: Explorer");
switch (int.Parse(GetInput()))
{
case 1:
logicalDrive.getInfo();
logicalDrive.GetInfo();
break;
case 2:
Process.Start(logicalDrive.name);
break;
default:
Process.Start(logicalDrive.Name);
break;
}
break;
@ -76,100 +99,54 @@ namespace WinPart {
Console.WriteLine("Invalid.");
break;
}
} catch (Exception e) { Console.WriteLine(e.ToString()); }
if (debug) Console.ReadKey();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
if (_debug) Console.ReadKey();
}
string getInput() {
private static string GetInput()
{
Console.Write("\r\n==> ");
var out_ = "";
if (longInputSupport)
out_ = Console.ReadLine();
else
out_ = Console.ReadKey().KeyChar.ToString();
string output = _longInputSupport ? Console.ReadLine() : Console.ReadKey().KeyChar.ToString();
Console.Write("\r\n\r\n");
return out_;
return output;
}
public void printInfo(ManagementObject mo, string s) {
public static void PrintInfo(ManagementBaseObject mo, string s)
{
string[] tmp1 = { };
PropertyData tmp2;
try {
try
{
tmp1 = s.Split(" ".ToCharArray());
if (tmp1[tmp1.Length - 1].EndsWith("[]")) {
tmp2 = mo.Properties[tmp1[tmp1.Length - 1].Replace("[]", "")];
PropertyData tmp2;
if (tmp1[^1].EndsWith("[]"))
{
tmp2 = mo.Properties[tmp1[^1].Replace("[]", "")];
string tmp3 = "[ ";
object[] list = (object[])tmp2.Value;
for (int i = 0; i < list.Length; i++) {
IList list = (Array) tmp2.Value;
for (int i = 0; i < list.Count; i++)
{
tmp3 += list[i].ToString();
if (i + 1 < list.Length) tmp3 += " | ";
if (i + 1 < list.Count) tmp3 += " | ";
}
tmp3 += " ]";
Console.WriteLine(tmp2.Name + ": " + tmp3);
} else {
tmp2 = mo.Properties[tmp1[tmp1.Length - 1]];
Console.WriteLine(tmp2.Name + ": " + tmp2.Value);
Console.WriteLine($"{tmp2.Name}: {tmp3}");
}
} catch (Exception e) { Console.Write("Could not read: " + tmp1[tmp1.Length - 1]); if (debug) Console.Write(" due to: " + e.ToString()); Console.Write("\r\n"); }
else
{
tmp2 = mo.Properties[tmp1[^1]];
Console.WriteLine($"{tmp2.Name}: {tmp2.Value}");
}
}
catch (Exception e)
{
Console.Write($"Could not read: {tmp1[^1]}");
if (_debug) Console.Write($" due to: {e}");
Console.Write(NewLine);
}
}
}
class Device {
public Program program;
public List<Partition> partitions;
public string name;
public ManagementObject mo;
public Device getFromMO(ManagementObject MO, Program program_) {
mo = MO;
program = program_;
partitions = new List<Partition>() { };
foreach (ManagementObject m in new ManagementObjectSearcher(string.Format("associators of {{{0}}} where AssocClass = Win32_DiskDriveToDiskPartition", MO.Path.RelativePath)).Get())
partitions.Add(new Partition().getFromMO(m, program));
name = (string)MO.Properties["Model"].Value;
return this;
}
public void getInfo() {
foreach (string s in Resources.Device.Split(new[] { "\r\n" }, StringSplitOptions.None))
program.printInfo(mo, s);
}
}
class Partition {
public Program program;
public List<LogicalDrive> logicalDrives;
public string name;
public ManagementObject mo;
public Partition getFromMO(ManagementObject MO, Program program_) {
mo = MO;
program = program_;
logicalDrives = new List<LogicalDrive>() { };
foreach (ManagementObject m in new ManagementObjectSearcher(string.Format("associators of {{{0}}} where AssocClass = Win32_LogicalDiskToPartition", MO.Path.RelativePath)).Get())
logicalDrives.Add(new LogicalDrive().getFromMO(m, program));
name = (string)MO.Properties["Type"].Value;
return this;
}
public void getInfo() {
foreach (string s in Resources.Partition.Split(new[] { "\r\n" }, StringSplitOptions.None))
program.printInfo(mo, s);
}
}
class LogicalDrive {
public Program program;
public string name;
public ManagementObject mo;
public LogicalDrive getFromMO(ManagementObject MO, Program program_) {
name = (string)MO.Properties["Name"].Value;
mo = MO;
program = program_;
return this;
}
public void getInfo() {
foreach (string s in Resources.Logical.Split(new[] { "\r\n" }, StringSplitOptions.None))
program.printInfo(mo, s);
}
}
}
}

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@ -32,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -8,10 +8,15 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
namespace WinPart.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -19,27 +24,27 @@ namespace WinPart.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[DebuggerNonUserCode()]
[CompilerGenerated()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinPart.Properties.Resources", typeof(Resources).Assembly);
if (ReferenceEquals(resourceMan, null)) {
ResourceManager temp = new ResourceManager("WinPart.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@ -50,8 +55,8 @@ namespace WinPart.Properties {
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture {
get {
return resourceCulture;
}
@ -61,7 +66,27 @@ namespace WinPart.Properties {
}
/// <summary>
/// Looks up a localized string similar to .
/// Looks up a localized string similar to uint16 Availability
///uint32 BytesPerSector
///uint16 Capabilities[]
///string CapabilityDescriptions[]
///string Caption
///string CompressionMethod
///uint32 ConfigManagerErrorCode
///boolean ConfigManagerUserConfig
///string CreationClassName
///uint64 DefaultBlockSize
///string Description
///string DeviceID
///boolean ErrorCleared
///string ErrorDescription
///string ErrorMethodology
///string FirmwareRevision
///uint32 Index
///datetime InstallDate
///string InterfaceType
///uint32 LastErrorCode
///strin [rest of string was truncated]&quot;;.
/// </summary>
internal static string Device {
get {
@ -70,33 +95,57 @@ namespace WinPart.Properties {
}
/// <summary>
/// Looks up a localized string similar to .
/// Looks up a localized string similar to uint16 Access
///uint16 Availability
///uint64 BlockSize
///string Caption
///boolean Compressed
///uint32 ConfigManagerErrorCode
///boolean ConfigManagerUserConfig
///string CreationClassName
///string Description
///string DeviceID
///uint32 DriveType
///boolean ErrorCleared
///string ErrorDescription
///string ErrorMethodology
///string FileSystem
///uint64 FreeSpace
///datetime InstallDate
///uint32 LastErrorCode
///uint32 MaximumComponentLength
///uint32 MediaType
///string Name
///uint64 NumberOfBlocks
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string Logical {
internal static string LogicalDrive {
get {
return ResourceManager.GetString("Logical", resourceCulture);
return ResourceManager.GetString("LogicalDrive", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to unit16 AdditionalAvailability;
/// uint16 Availability;
/// uint16 PowerManagementCapabilities[];
/// string IdentifyingDescriptions[1];
/// uint64 MaxQuiesceTime;
/// uint64 OtherIdentifyingInfo;
/// uint16 StatusInfo;
/// uint64 PowerOnHours;
/// uint64 TotalPowerOnHours;
/// uint16 Access;
/// uint64 BlockSize;
/// boolean Bootable;
/// boolean BootPartition;
/// string. Caption;
/// uint32 ConfigManagerErrorCode;
/// boolean ConfigManagerUserConfig;
/// string. CreationClassName;
/// strin [rest of string was truncated]&quot;;.
/// Looks up a localized string similar to unit16 AdditionalAvailability
///uint16 Availability
///uint16 PowerManagementCapabilities[]
///string IdentifyingDescriptions[1]
///uint64 MaxQuiesceTime
///uint64 OtherIdentifyingInfo
///uint16 StatusInfo
///uint64 PowerOnHours
///uint64 TotalPowerOnHours
///uint16 Access
///uint64 BlockSize
///boolean Bootable
///boolean BootPartition
///string. Caption
///uint32 ConfigManagerErrorCode
///boolean ConfigManagerUserConfig
///string. CreationClassName
///string Description
///string DeviceID
///uint32 DiskInde [rest of string was truncated]&quot;;.
/// </summary>
internal static string Partition {
get {

View File

@ -119,12 +119,12 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Device" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\Device.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
<value>..\data structure\device.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Logical" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\Logical.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
<data name="LogicalDrive" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\data structure\logicaldrive.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Partition" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\Partition.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
<value>..\data structure\partition.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>

View File

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WinPart.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -1,6 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

View File

@ -1,119 +1,38 @@
<?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')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2EF21D5A-1476-4C07-8D1F-5440231547AE}</ProjectGuid>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>WinPart</RootNamespace>
<AssemblyName>WinPart</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
<Deterministic>false</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 />
<PropertyGroup />
<PropertyGroup>
<StartupObject>WinPart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<PostBuildEvent>
echo @echo off > WinPart.bat
echo start %%~dp0WinPart.exe -debug >> WinPart.bat
if exist "$(SolutionDir)Data\pkgtool.exe" ($(SolutionDir)Data\pkgtool.exe build --noLogo --binDir . --mainBin WinPart.bat) else if exist "%appdata%\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app\pkgtool.exe" ("%appdata%\UpTool2\Apps\0e35d154-d0d3-45e0-b080-62f521263a44\app\pkgtool.exe" build --noLogo --binDir . --mainBin WinPart.bat) else echo Cound not find Package build tools, skipping
</PostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CLU.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<Content Include="Data structure\Device.txt" />
<Content Include="Data structure\LogicalDrive.txt" />
<Content Include="Data structure\Partition.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="Data\Device.txt" />
<Content Include="Data\Logical.txt" />
<Content Include="Data\Partition.txt" />
<PackageReference Include="System.Management" Version="4.7.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

5
renovate.json Normal file
View File

@ -0,0 +1,5 @@
{
"extends": [
"config:base"
]
}