mirror of https://github.com/quasar/Quasar.git
Compare commits
4 Commits
16a4702d0e
...
a7003e8d28
Author | SHA1 | Date |
---|---|---|
MaxXor | a7003e8d28 | |
MaxXor | b9da8df8fe | |
MaxXor | 8a481096f3 | |
MaxXor | 8d3b84e950 |
|
@ -58,14 +58,14 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ILRepack.Lib.MSBuild.Task">
|
||||
<Version>2.0.18.1</Version>
|
||||
<Version>2.0.18.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MouseKeyHook">
|
||||
<Version>5.6.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.6.7" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
|
||||
<PackageReference Include="protobuf-net">
|
||||
<Version>2.4.6</Version>
|
||||
<Version>2.4.8</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -12,9 +12,9 @@
|
|||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Quasar.Common\Quasar.Common.csproj" />
|
||||
|
|
|
@ -20,18 +20,12 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="protobuf-net">
|
||||
<Version>2.4.6</Version>
|
||||
<Version>2.4.8</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
<PackageReference Include="Microsoft.Win32.Registry">
|
||||
<Version>4.7.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Drawing.Common">
|
||||
<Version>4.7.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Management">
|
||||
<Version>4.7.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Win32.Registry" />
|
||||
<PackageReference Include="System.Drawing.Common" />
|
||||
<PackageReference Include="System.Management" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -14,7 +14,7 @@ namespace Quasar.Server.Controls
|
|||
private const short UISF_HIDEFOCUS = 0x1;
|
||||
private readonly IntPtr _removeDots = new IntPtr(NativeMethodsHelper.MakeWin32Long(UIS_SET, UISF_HIDEFOCUS));
|
||||
|
||||
private ListViewColumnSorter LvwColumnSorter { get; set; }
|
||||
public ListViewColumnSorter LvwColumnSorter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AeroListView"/> class.
|
||||
|
|
|
@ -87,6 +87,7 @@ namespace Quasar.Server.Forms
|
|||
this.lstConnections.TabIndex = 0;
|
||||
this.lstConnections.UseCompatibleStateImageBehavior = false;
|
||||
this.lstConnections.View = System.Windows.Forms.View.Details;
|
||||
this.lstConnections.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstConnections_ColumnClick);
|
||||
//
|
||||
// columnHeader1
|
||||
//
|
||||
|
|
|
@ -160,5 +160,10 @@ namespace Quasar.Server.Forms
|
|||
_connectionsHandler.RefreshTcpConnections();
|
||||
}
|
||||
}
|
||||
|
||||
private void lstConnections_ColumnClick(object sender, ColumnClickEventArgs e)
|
||||
{
|
||||
lstConnections.LvwColumnSorter.NeedNumberCompare = (e.Column == 2 || e.Column == 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -332,6 +332,7 @@ namespace Quasar.Server.Forms
|
|||
this.lstDirectory.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstDirectory_DragDrop);
|
||||
this.lstDirectory.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstDirectory_DragEnter);
|
||||
this.lstDirectory.DoubleClick += new System.EventHandler(this.lstDirectory_DoubleClick);
|
||||
this.lstDirectory.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstDirectory_ColumnClick);
|
||||
//
|
||||
// hName
|
||||
//
|
||||
|
|
|
@ -250,7 +250,6 @@ namespace Quasar.Server.Forms
|
|||
private void FrmFileManager_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Text = WindowHelper.GetWindowTitle("File Manager", _connectClient);
|
||||
|
||||
_fileManagerHandler.RefreshDrives();
|
||||
}
|
||||
|
||||
|
@ -269,9 +268,9 @@ namespace Quasar.Server.Forms
|
|||
{
|
||||
if (lstDirectory.SelectedItems.Count > 0)
|
||||
{
|
||||
FileType type = (FileType) lstDirectory.SelectedItems[0].Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag) lstDirectory.SelectedItems[0].Tag;
|
||||
|
||||
switch (type)
|
||||
switch (tag.Type)
|
||||
{
|
||||
case FileType.Back:
|
||||
SwitchDirectory(NavigateUp());
|
||||
|
@ -283,13 +282,18 @@ namespace Quasar.Server.Forms
|
|||
}
|
||||
}
|
||||
|
||||
private void lstDirectory_ColumnClick(object sender, ColumnClickEventArgs e)
|
||||
{
|
||||
lstDirectory.LvwColumnSorter.NeedNumberCompare = (e.Column == 1);
|
||||
}
|
||||
|
||||
private void downloadToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (ListViewItem files in lstDirectory.SelectedItems)
|
||||
{
|
||||
FileType type = (FileType)files.Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag)files.Tag;
|
||||
|
||||
if (type == FileType.File)
|
||||
if (tag.Type == FileType.File)
|
||||
{
|
||||
string remotePath = GetAbsolutePath(files.SubItems[0].Text);
|
||||
|
||||
|
@ -324,9 +328,9 @@ namespace Quasar.Server.Forms
|
|||
{
|
||||
foreach (ListViewItem files in lstDirectory.SelectedItems)
|
||||
{
|
||||
FileType type = (FileType) files.Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag) files.Tag;
|
||||
|
||||
if (type == FileType.File)
|
||||
if (tag.Type == FileType.File)
|
||||
{
|
||||
string remotePath = GetAbsolutePath(files.SubItems[0].Text);
|
||||
|
||||
|
@ -339,9 +343,9 @@ namespace Quasar.Server.Forms
|
|||
{
|
||||
foreach (ListViewItem files in lstDirectory.SelectedItems)
|
||||
{
|
||||
FileType type = (FileType)files.Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag)files.Tag;
|
||||
|
||||
switch (type)
|
||||
switch (tag.Type)
|
||||
{
|
||||
case FileType.Directory:
|
||||
case FileType.File:
|
||||
|
@ -351,7 +355,7 @@ namespace Quasar.Server.Forms
|
|||
if (InputBox.Show("New name", "Enter new name:", ref newName) == DialogResult.OK)
|
||||
{
|
||||
newName = GetAbsolutePath(newName);
|
||||
_fileManagerHandler.RenameFile(path, newName, type);
|
||||
_fileManagerHandler.RenameFile(path, newName, tag.Type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -367,14 +371,14 @@ namespace Quasar.Server.Forms
|
|||
{
|
||||
foreach (ListViewItem files in lstDirectory.SelectedItems)
|
||||
{
|
||||
FileType type = (FileType)files.Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag)files.Tag;
|
||||
|
||||
switch (type)
|
||||
switch (tag.Type)
|
||||
{
|
||||
case FileType.Directory:
|
||||
case FileType.File:
|
||||
string path = GetAbsolutePath(files.SubItems[0].Text);
|
||||
_fileManagerHandler.DeleteFile(path, type);
|
||||
_fileManagerHandler.DeleteFile(path, tag.Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -385,9 +389,9 @@ namespace Quasar.Server.Forms
|
|||
{
|
||||
foreach (ListViewItem files in lstDirectory.SelectedItems)
|
||||
{
|
||||
FileType type = (FileType)files.Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag)files.Tag;
|
||||
|
||||
if (type == FileType.File)
|
||||
if (tag.Type == FileType.File)
|
||||
{
|
||||
string path = GetAbsolutePath(files.SubItems[0].Text);
|
||||
|
||||
|
@ -413,9 +417,9 @@ namespace Quasar.Server.Forms
|
|||
if (lstDirectory.SelectedItems.Count == 1)
|
||||
{
|
||||
var item = lstDirectory.SelectedItems[0];
|
||||
FileType type = (FileType)item.Tag;
|
||||
FileManagerListTag tag = (FileManagerListTag)item.Tag;
|
||||
|
||||
if (type == FileType.Directory)
|
||||
if (tag.Type == FileType.Directory)
|
||||
{
|
||||
path = GetAbsolutePath(item.SubItems[0].Text);
|
||||
}
|
||||
|
@ -424,7 +428,8 @@ namespace Quasar.Server.Forms
|
|||
FrmRemoteShell frmRs = FrmRemoteShell.CreateNewOrGetExisting(_connectClient);
|
||||
frmRs.Show();
|
||||
frmRs.Focus();
|
||||
frmRs.RemoteShellHandler.SendCommand($"cd \"{path}\"");
|
||||
var driveLetter = Path.GetPathRoot(path);
|
||||
frmRs.RemoteShellHandler.SendCommand($"{driveLetter.Remove(driveLetter.Length - 1)} && cd \"{path}\"");
|
||||
}
|
||||
|
||||
private void btnOpenDLFolder_Click(object sender, EventArgs e)
|
||||
|
@ -513,7 +518,7 @@ namespace Quasar.Server.Forms
|
|||
(type != FileType.Back) ? type.ToString() : string.Empty
|
||||
})
|
||||
{
|
||||
Tag = type,
|
||||
Tag = new FileManagerListTag(type, size),
|
||||
ImageIndex = imageIndex
|
||||
};
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ namespace Quasar.Server.Forms
|
|||
this.lstTasks.TabIndex = 1;
|
||||
this.lstTasks.UseCompatibleStateImageBehavior = false;
|
||||
this.lstTasks.View = System.Windows.Forms.View.Details;
|
||||
this.lstTasks.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstTasks_ColumnClick);
|
||||
//
|
||||
// hProcessname
|
||||
//
|
||||
|
|
|
@ -157,5 +157,10 @@ namespace Quasar.Server.Forms
|
|||
{
|
||||
_taskManagerHandler.RefreshProcesses();
|
||||
}
|
||||
|
||||
private void lstTasks_ColumnClick(object sender, ColumnClickEventArgs e)
|
||||
{
|
||||
lstTasks.LvwColumnSorter.NeedNumberCompare = (e.Column == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
using Quasar.Common.Enums;
|
||||
|
||||
namespace Quasar.Server.Models
|
||||
{
|
||||
public class FileManagerListTag
|
||||
{
|
||||
public FileType Type { get; set; }
|
||||
|
||||
public long FileSize { get; set; }
|
||||
|
||||
public FileManagerListTag(FileType type, long fileSize)
|
||||
{
|
||||
this.Type = type;
|
||||
this.FileSize = fileSize;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -301,15 +301,15 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mono.Cecil">
|
||||
<Version>0.11.2</Version>
|
||||
<Version>0.11.4</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MouseKeyHook">
|
||||
<Version>5.6.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Open.Nat" Version="2.1.0" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.6.7" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
|
||||
<PackageReference Include="protobuf-net">
|
||||
<Version>2.4.6</Version>
|
||||
<Version>2.4.8</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Vestris.ResourceLib">
|
||||
<Version>2.1.0</Version>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections;
|
||||
using Quasar.Server.Models;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Quasar.Server.Utilities
|
||||
|
@ -20,6 +21,11 @@ namespace Quasar.Server.Utilities
|
|||
/// </summary>
|
||||
private readonly CaseInsensitiveComparer _objectCompare;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies if number or text comparision is needed
|
||||
/// </summary>
|
||||
private bool _needNumberCompare;
|
||||
|
||||
/// <summary>
|
||||
/// Class constructor. Initializes various elements
|
||||
/// </summary>
|
||||
|
@ -33,6 +39,8 @@ namespace Quasar.Server.Utilities
|
|||
|
||||
// Initialize the CaseInsensitiveComparer object
|
||||
_objectCompare = new CaseInsensitiveComparer();
|
||||
|
||||
_needNumberCompare = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -51,8 +59,39 @@ namespace Quasar.Server.Utilities
|
|||
return 0;
|
||||
|
||||
// Compare the two items
|
||||
var compareResult = _objectCompare.Compare(listviewX.SubItems[_columnToSort].Text,
|
||||
listviewY.SubItems[_columnToSort].Text);
|
||||
int compareResult;
|
||||
|
||||
if (_needNumberCompare)
|
||||
{
|
||||
long a, b;
|
||||
|
||||
if (listviewX.Tag is FileManagerListTag)
|
||||
{
|
||||
// fileSize to be compared
|
||||
a = (listviewX.Tag as FileManagerListTag).FileSize;
|
||||
b = (listviewY.Tag as FileManagerListTag).FileSize;
|
||||
compareResult = a >= b ? (a == b ? 0 : 1) : -1;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (long.TryParse(listviewX.SubItems[_columnToSort].Text, out a)
|
||||
&& long.TryParse(listviewY.SubItems[_columnToSort].Text, out b))
|
||||
{
|
||||
compareResult = a >= b ? (a == b ? 0 : 1) : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
compareResult = _objectCompare.Compare(listviewX.SubItems[_columnToSort].Text,
|
||||
listviewY.SubItems[_columnToSort].Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
compareResult = _objectCompare.Compare(listviewX.SubItems[_columnToSort].Text,
|
||||
listviewY.SubItems[_columnToSort].Text);
|
||||
}
|
||||
|
||||
// Calculate correct return value based on object comparison
|
||||
if (_orderOfSort == SortOrder.Ascending)
|
||||
|
@ -89,5 +128,14 @@ namespace Quasar.Server.Utilities
|
|||
set { _orderOfSort = value; }
|
||||
get { return _orderOfSort; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies if number or text comparision is needed.
|
||||
/// </summary>
|
||||
public bool NeedNumberCompare
|
||||
{
|
||||
set { _needNumberCompare = value; }
|
||||
get { return _needNumberCompare; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,8 +19,8 @@ Quasar is a fast and light-weight remote administration tool coded in C#. The us
|
|||
## Features
|
||||
* TCP network stream (IPv4 & IPv6 support)
|
||||
* Fast network serialization (Protocol Buffers)
|
||||
* Compressed (QuickLZ) & Encrypted (TLS) communication
|
||||
* UPnP Support
|
||||
* Encrypted communication (TLS)
|
||||
* UPnP Support (automatic port forwarding)
|
||||
* Task Manager
|
||||
* File Manager
|
||||
* Startup Manager
|
||||
|
@ -42,14 +42,15 @@ Quasar is a fast and light-weight remote administration tool coded in C#. The us
|
|||
## Supported runtimes and operating systems
|
||||
* .NET Framework 4.5.2 or higher
|
||||
* Supported operating systems (32- and 64-bit)
|
||||
* Windows 11
|
||||
* Windows Server 2022
|
||||
* Windows 10
|
||||
* Windows Server 2019
|
||||
* Windows Server 2016
|
||||
* Windows 8/8.1
|
||||
* Windows Server 2012
|
||||
* Windows 7
|
||||
* Windows Server 2008
|
||||
* Windows Vista
|
||||
* Windows Server 2008 R2
|
||||
* For older systems please use [Quasar version 1.3.0](https://github.com/quasar/Quasar/releases/tag/v1.3.0.0)
|
||||
|
||||
## Compiling
|
||||
|
|
Loading…
Reference in New Issue