Skip to content

Commit

Permalink
version 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
KrxkGit committed Apr 27, 2024
1 parent 4975764 commit c0a683e
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 8 deletions.
10 changes: 10 additions & 0 deletions HelpUploadFiles.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorkDll", "WorkDll\WorkDll.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IgnoreInfoFormat", "IgnoreInfoFormat\IgnoreInfoFormat.vcxitems", "{E904B7EC-60EF-4BCA-AEF5-2F7983E8FB9D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Startup", "Startup\Startup.vcxproj", "{4E1E201F-518E-4A18-90F1-F1AFA01015A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -36,6 +38,14 @@ Global
{9366E397-8E3A-4B62-8520-8412F8AF6182}.Release|x64.Build.0 = Release|x64
{9366E397-8E3A-4B62-8520-8412F8AF6182}.Release|x86.ActiveCfg = Release|Win32
{9366E397-8E3A-4B62-8520-8412F8AF6182}.Release|x86.Build.0 = Release|Win32
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Debug|x64.ActiveCfg = Debug|x64
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Debug|x64.Build.0 = Debug|x64
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Debug|x86.ActiveCfg = Debug|Win32
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Debug|x86.Build.0 = Debug|Win32
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Release|x64.ActiveCfg = Release|x64
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Release|x64.Build.0 = Release|x64
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Release|x86.ActiveCfg = Release|Win32
{4E1E201F-518E-4A18-90F1-F1AFA01015A5}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified HelpUploadFiles/HelpUploadFiles.rc
Binary file not shown.
56 changes: 48 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## 🍺简介

***HelpUploadFiles (星空上传助手)*** 是一款支持 **辅助上传** 的工具。我们知道,*git* 提供了 **.gitignore** 文件用于根据规则忽略某些文件的上传,但是这个功能仅限于 *git*,还有很多场景涉及**文件的上传**,比如我们可能需要将某些文件上传到网盘,但是大部分网盘并不具备 ***根据规则忽略指定文件*** 的功能,这十分不方便。另外,还存在着许许多多的上传文件的场景,此时,***HelpUploadFiles*** 油然而生!
***HelpUploadFiles (星空上传助手)*** 是一款 **辅助上传** 工具。我们知道,*git* 提供了 **.gitignore** 文件用于根据规则忽略某些文件的上传,但是这个功能仅限于 *git*,还有很多场景涉及**文件的上传**,比如我们可能需要将某些文件上传到网盘,但是大部分网盘并不具备 ***根据规则忽略指定文件*** 的功能,这十分不方便。另外,还存在着许许多多的上传文件的场景,此时,***HelpUploadFiles*** 油然而生!

由于对于单个文件,不需要特别的规则进行忽略上传,故 ***HelpUploadFiles*** 主要是针对 ***文件夹*** 的上传常见
由于对于单个文件,不需要特别的规则进行忽略上传,故 ***HelpUploadFiles*** 主要是针对 ***文件夹*** 的上传场景

## 🍺文件上传概念的推广

***HelpUploadFiles*** 涉及的文件上传并不仅仅局限于将本机文件上传到网盘这种场景,在 ***HelpUploadFiles*** 中,凡是需要 **将某个文件夹发送到某一个接口** 的操作都可推广为文件上传
***HelpUploadFiles*** 涉及的文件上传并不仅仅局限于将本机文件上传到网盘这种场景,在 ***HelpUploadFiles*** 中,凡是需要 **将某个文件夹发送到某一个接口** 的操作均可推广为文件上传

以下场景均可视文件上传概念的推广:

1. 将本机文件夹上传到**网盘**
1. 将本机文件夹上传到**网盘**
2. 将本机文件夹发送到**另一台设备**(如局域网内设备、服务器对象存储服务等)。
3. 将本机文件夹发送到**压缩软件**等接口。

Expand All @@ -21,7 +21,7 @@
以下场景均已验证通过:

1. **Chromium 浏览器** 涉及的文件夹上传
2. **Edge 浏览器 **涉及的文件夹上传
2. **Edge 浏览器** 涉及的文件夹上传
3. 百度网盘客户端
4. 腾讯微云客户端
5. 阿里网盘
Expand All @@ -38,12 +38,12 @@
16. LocalSend
17. Send Anywhere 客户端
18. WinSCP
19. 7z、Bandizip、360等压缩软件
19. 7z、Bandizip、360压缩等压缩软件

## 📍使用注意事项

1. ***HelpUploadFiles*** 分为 ***32位******64位*** 两个版本,需要根据不同的上传接口选择不同的版本,如目前百度网盘客户端是32位的,则需要使用32位版本的 ***HelpUploadFiles***;而64位系统的Edge浏览器是64位程序,则需要使用64位版本的 ***HelpUploadFiles***
2. 目前版本(v1.0.2)仅支持同时拦截一个进程的文件上传行为,值得注意的是 ***32位 与 64位版本 加起来一共能同时拦截一个进程***。且 ***添加/移除*** 忽略列表的操作**仅对当前拦截的进程有效****若切换进程,即使重新注入,也需要重新添加忽略列表(移除后重新添加),否则将无效。**这是由于目前采用的进程通信方案导致的。
2. 目前版本(v1.0.2)仅支持同时拦截一个进程的文件上传行为,值得注意的是 ***32位 与 64位版本 加起来一共能同时拦截一个进程***。且 ***添加/移除*** 忽略列表的操作 **仅对当前拦截的进程有效若切换进程,即使重新注入,也需要重新添加忽略列表(移除后重新添加),否则将无效。** 这是由于目前采用的进程通信方案导致的。
3. 对于下方输入框手动输入的忽略规则,将采用 **C++ 正则表达式规则**
4. 对于拖拽上传的文件,将自动进行转义使其符合 **C++正则表达式规则**

Expand Down Expand Up @@ -136,6 +136,46 @@
| LocalSend | 主窗口 |
| 7z、Bandizip 等64位压缩工具 | 压缩菜单弹出窗口 |

## 🟡已发现的不完全适应情况
## 🍗操作视频演示(以7z压缩软件为例)

<img src="https://github.com/KrxkGit/HelpUploadFiles/blob/main/documents/imgs/8.gif" alt="演示视频" style="zoom: 80%;" />

## 🌭C++正则表达式附录

正则表达式是一种用于描述字符串模式的工具,它可以帮助您在文本中进行搜索、匹配、替换等操作。以下是一些常用的正则表达式规则和符号:

1. 字符类别:
- `\d`:匹配任意一个数字字符,相当于 `[0-9]`
- `\D`:匹配任意一个非数字字符,相当于 `[^0-9]`
- `\w`:匹配任意一个字母、数字或下划线字符,相当于 `[a-zA-Z0-9_]`
- `\W`:匹配任意一个非字母、数字或下划线字符,相当于 `[^a-zA-Z0-9_]`
- `\s`:匹配任意一个空白字符,包括空格、制表符、换行符等。
- `\S`:匹配任意一个非空白字符。

2. 重复次数:
- `*`:匹配前面的字符零次或多次。
- `+`:匹配前面的字符一次或多次。
- `?`:匹配前面的字符零次或一次。
- `{n}`:匹配前面的字符恰好 n 次。
- `{n,}`:匹配前面的字符至少 n 次。
- `{n,m}`:匹配前面的字符至少 n 次,最多 m 次。

3. 边界匹配:
- `^`:匹配字符串的开头。
- `$`:匹配字符串的结尾。
- `\b`:匹配单词边界。

4. 分组和引用:
- `()`:将其中的字符视为一个整体,可以用于分组操作。
- `\1`, `\2`, ...:引用分组中的匹配结果。

5. 特殊字符转义:
- `\`:用于转义特殊字符,例如 `\.` 表示匹配点字符 `.`

6. 其他常用符号:
- `|`:表示或操作,匹配两者之一。
- `.`:匹配任意一个字符,除了换行符。

## 🟡已发现的不完全适用情况

- 比特球网盘 未完全兼容,存在目录创建失败问题。
66 changes: 66 additions & 0 deletions Startup/Startup.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Startup.cpp : 定义应用程序的入口点。
//

#include "framework.h"
#include "Startup.h"

HINSTANCE hInst;
LPCTSTR programName = _T("HelpUploadFiles.exe");

int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

// TODO: 在此处放置代码。
hInst = hInstance;
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), NULL, MainDlg);

}

VOID OnDlgInit(HWND hDlg)
{

HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STARTUP));;
SendMessage(hDlg, WM_SETICON, FALSE, (LPARAM)hIcon);
}

VOID OnDlgCommand(HWND hDlg, WPARAM wParam)
{
TCHAR szWorkDirectory[MAX_PATH];
GetCurrentDirectory(_countof(szWorkDirectory), szWorkDirectory);

switch (LOWORD(wParam))
{
case IDC_BUTTON1: // 32位
std::swprintf(szWorkDirectory, _countof(szWorkDirectory), _T("%s\\x86"), szWorkDirectory);
break;
case IDC_BUTTON2: // 64位
std::swprintf(szWorkDirectory, _countof(szWorkDirectory), _T("%s\\x64"), szWorkDirectory);
break;
case IDCANCEL:
EndDialog(hDlg, LOWORD(wParam));
return;
}
ShellExecute(NULL, _T("Open"), programName, NULL, szWorkDirectory, SW_SHOWNORMAL);
EndDialog(hDlg, LOWORD(wParam));
}

INT_PTR CALLBACK MainDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
OnDlgInit(hDlg);
break;

case WM_COMMAND:
OnDlgCommand(hDlg, wParam);
break;
}
return (INT_PTR)FALSE;
}
7 changes: 7 additions & 0 deletions Startup/Startup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include "resource.h"

INT_PTR CALLBACK MainDlg(HWND, UINT, WPARAM, LPARAM);
VOID OnDlgCommand(HWND hDlg, WPARAM wParam);
VOID OnDlgCommand(HWND hDlg, WPARAM wParam);
Binary file added Startup/Startup.rc
Binary file not shown.
147 changes: 147 additions & 0 deletions Startup/Startup.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{4e1e201f-518e-4a18-90f1-f1afa01015a5}</ProjectGuid>
<RootNamespace>Startup</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="Startup.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Startup.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Startup.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="..\HelpUploadFiles\HelpUploadFiles.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
46 changes: 46 additions & 0 deletions Startup/Startup.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Startup.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Startup.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Startup.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="..\HelpUploadFiles\HelpUploadFiles.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project>
Loading

0 comments on commit c0a683e

Please sign in to comment.