├── .gitattributes
├── .gitignore
├── File Unlock.sln
├── File Unlock
├── 256X256.ico
├── App.config
├── App.xaml
├── App.xaml.cs
├── Delete_Class.cs
├── Drag_and_drop.cs
├── File Unlock.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Perform_Operation.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ ├── Settings.settings
│ └── app.manifest
├── check.cs
└── packages.config
├── IObitUnlocker.Wrapper
├── FileOperation.cs
├── IObitController.cs
├── IObitUnlocker.Wrapper.csproj
├── Native.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
└── Resources
│ ├── IObitUnlocker.dll
│ └── IObitUnlocker.sys
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 |
30 | # Visual Studio 2015/2017 cache/options directory
31 | .vs/
32 | # Uncomment if you have tasks that create the project's static files in wwwroot
33 | #wwwroot/
34 |
35 | # Visual Studio 2017 auto generated files
36 | Generated\ Files/
37 |
38 | # MSTest test Results
39 | [Tt]est[Rr]esult*/
40 | [Bb]uild[Ll]og.*
41 |
42 | # NUNIT
43 | *.VisualState.xml
44 | TestResult.xml
45 |
46 | # Build Results of an ATL Project
47 | [Dd]ebugPS/
48 | [Rr]eleasePS/
49 | dlldata.c
50 |
51 | # Benchmark Results
52 | BenchmarkDotNet.Artifacts/
53 |
54 | # .NET Core
55 | project.lock.json
56 | project.fragment.lock.json
57 | artifacts/
58 |
59 | # StyleCop
60 | StyleCopReport.xml
61 |
62 | # Files built by Visual Studio
63 | *_i.c
64 | *_p.c
65 | *_h.h
66 | *.ilk
67 | *.meta
68 | *.obj
69 | *.iobj
70 | *.pch
71 | *.pdb
72 | *.ipdb
73 | *.pgc
74 | *.pgd
75 | *.rsp
76 | *.sbr
77 | *.tlb
78 | *.tli
79 | *.tlh
80 | *.tmp
81 | *.tmp_proj
82 | *_wpftmp.csproj
83 | *.log
84 | *.vspscc
85 | *.vssscc
86 | .builds
87 | *.pidb
88 | *.svclog
89 | *.scc
90 |
91 | # Chutzpah Test files
92 | _Chutzpah*
93 |
94 | # Visual C++ cache files
95 | ipch/
96 | *.aps
97 | *.ncb
98 | *.opendb
99 | *.opensdf
100 | *.sdf
101 | *.cachefile
102 | *.VC.db
103 | *.VC.VC.opendb
104 |
105 | # Visual Studio profiler
106 | *.psess
107 | *.vsp
108 | *.vspx
109 | *.sap
110 |
111 | # Visual Studio Trace Files
112 | *.e2e
113 |
114 | # TFS 2012 Local Workspace
115 | $tf/
116 |
117 | # Guidance Automation Toolkit
118 | *.gpState
119 |
120 | # ReSharper is a .NET coding add-in
121 | _ReSharper*/
122 | *.[Rr]e[Ss]harper
123 | *.DotSettings.user
124 |
125 | # JustCode is a .NET coding add-in
126 | .JustCode
127 |
128 | # TeamCity is a build add-in
129 | _TeamCity*
130 |
131 | # DotCover is a Code Coverage Tool
132 | *.dotCover
133 |
134 | # AxoCover is a Code Coverage Tool
135 | .axoCover/*
136 | !.axoCover/settings.json
137 |
138 | # Visual Studio code coverage results
139 | *.coverage
140 | *.coveragexml
141 |
142 | # NCrunch
143 | _NCrunch_*
144 | .*crunch*.local.xml
145 | nCrunchTemp_*
146 |
147 | # MightyMoose
148 | *.mm.*
149 | AutoTest.Net/
150 |
151 | # Web workbench (sass)
152 | .sass-cache/
153 |
154 | # Installshield output folder
155 | [Ee]xpress/
156 |
157 | # DocProject is a documentation generator add-in
158 | DocProject/buildhelp/
159 | DocProject/Help/*.HxT
160 | DocProject/Help/*.HxC
161 | DocProject/Help/*.hhc
162 | DocProject/Help/*.hhk
163 | DocProject/Help/*.hhp
164 | DocProject/Help/Html2
165 | DocProject/Help/html
166 |
167 | # Click-Once directory
168 | publish/
169 |
170 | # Publish Web Output
171 | *.[Pp]ublish.xml
172 | *.azurePubxml
173 | # Note: Comment the next line if you want to checkin your web deploy settings,
174 | # but database connection strings (with potential passwords) will be unencrypted
175 | *.pubxml
176 | *.publishproj
177 |
178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
179 | # checkin your Azure Web App publish settings, but sensitive information contained
180 | # in these scripts will be unencrypted
181 | PublishScripts/
182 |
183 | # NuGet Packages
184 | *.nupkg
185 | # The packages folder can be ignored because of Package Restore
186 | **/[Pp]ackages/*
187 | # except build/, which is used as an MSBuild target.
188 | !**/[Pp]ackages/build/
189 | # Uncomment if necessary however generally it will be regenerated when needed
190 | #!**/[Pp]ackages/repositories.config
191 | # NuGet v3's project.json files produces more ignorable files
192 | *.nuget.props
193 | *.nuget.targets
194 |
195 | # Microsoft Azure Build Output
196 | csx/
197 | *.build.csdef
198 |
199 | # Microsoft Azure Emulator
200 | ecf/
201 | rcf/
202 |
203 | # Windows Store app package directories and files
204 | AppPackages/
205 | BundleArtifacts/
206 | Package.StoreAssociation.xml
207 | _pkginfo.txt
208 | *.appx
209 |
210 | # Visual Studio cache files
211 | # files ending in .cache can be ignored
212 | *.[Cc]ache
213 | # but keep track of directories ending in .cache
214 | !?*.[Cc]ache/
215 |
216 | # Others
217 | ClientBin/
218 | ~$*
219 | *~
220 | *.dbmdl
221 | *.dbproj.schemaview
222 | *.jfm
223 | *.pfx
224 | *.publishsettings
225 | orleans.codegen.cs
226 |
227 | # Including strong name files can present a security risk
228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
229 | #*.snk
230 |
231 | # Since there are multiple workflows, uncomment next line to ignore bower_components
232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
233 | #bower_components/
234 |
235 | # RIA/Silverlight projects
236 | Generated_Code/
237 |
238 | # Backup & report files from converting an old project file
239 | # to a newer Visual Studio version. Backup files are not needed,
240 | # because we have git ;-)
241 | _UpgradeReport_Files/
242 | Backup*/
243 | UpgradeLog*.XML
244 | UpgradeLog*.htm
245 | ServiceFabricBackup/
246 | *.rptproj.bak
247 |
248 | # SQL Server files
249 | *.mdf
250 | *.ldf
251 | *.ndf
252 |
253 | # Business Intelligence projects
254 | *.rdl.data
255 | *.bim.layout
256 | *.bim_*.settings
257 | *.rptproj.rsuser
258 | *- Backup*.rdl
259 |
260 | # Microsoft Fakes
261 | FakesAssemblies/
262 |
263 | # GhostDoc plugin setting file
264 | *.GhostDoc.xml
265 |
266 | # Node.js Tools for Visual Studio
267 | .ntvs_analysis.dat
268 | node_modules/
269 |
270 | # Visual Studio 6 build log
271 | *.plg
272 |
273 | # Visual Studio 6 workspace options file
274 | *.opt
275 |
276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
277 | *.vbw
278 |
279 | # Visual Studio LightSwitch build output
280 | **/*.HTMLClient/GeneratedArtifacts
281 | **/*.DesktopClient/GeneratedArtifacts
282 | **/*.DesktopClient/ModelManifest.xml
283 | **/*.Server/GeneratedArtifacts
284 | **/*.Server/ModelManifest.xml
285 | _Pvt_Extensions
286 |
287 | # Paket dependency manager
288 | .paket/paket.exe
289 | paket-files/
290 |
291 | # FAKE - F# Make
292 | .fake/
293 |
294 | # JetBrains Rider
295 | .idea/
296 | *.sln.iml
297 |
298 | # CodeRush personal settings
299 | .cr/personal
300 |
301 | # Python Tools for Visual Studio (PTVS)
302 | __pycache__/
303 | *.pyc
304 |
305 | # Cake - Uncomment if you are using it
306 | # tools/**
307 | # !tools/packages.config
308 |
309 | # Tabs Studio
310 | *.tss
311 |
312 | # Telerik's JustMock configuration file
313 | *.jmconfig
314 |
315 | # BizTalk build output
316 | *.btp.cs
317 | *.btm.cs
318 | *.odx.cs
319 | *.xsd.cs
320 |
321 | # OpenCover UI analysis results
322 | OpenCover/
323 |
324 | # Azure Stream Analytics local run output
325 | ASALocalRun/
326 |
327 | # MSBuild Binary and Structured Log
328 | *.binlog
329 |
330 | # NVidia Nsight GPU debugger configuration file
331 | *.nvuser
332 |
333 | # MFractors (Xamarin productivity tool) working folder
334 | .mfractor/
335 |
336 | # Local History for Visual Studio
337 | .localhistory/
338 |
339 | # BeatPulse healthcheck temp database
340 | healthchecksdb
--------------------------------------------------------------------------------
/File Unlock.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30907.101
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File Unlock", "File Unlock\File Unlock.csproj", "{B29290B0-6C48-4E0B-986D-72B6074FC8A3}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IObitUnlocker.Wrapper", "IObitUnlocker.Wrapper\IObitUnlocker.Wrapper.csproj", "{FA5EFADA-E935-4DD8-89AE-2F657B311B77}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|x86 = Debug|x86
14 | Release|Any CPU = Release|Any CPU
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Debug|x86.ActiveCfg = Debug|Any CPU
21 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Debug|x86.Build.0 = Debug|Any CPU
22 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Release|x86.ActiveCfg = Release|Any CPU
25 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}.Release|x86.Build.0 = Release|Any CPU
26 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Debug|x86.ActiveCfg = Debug|Any CPU
29 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Debug|x86.Build.0 = Debug|Any CPU
30 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Release|x86.ActiveCfg = Release|Any CPU
33 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}.Release|x86.Build.0 = Release|Any CPU
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | GlobalSection(ExtensibilityGlobals) = postSolution
39 | SolutionGuid = {BB77C959-D6A6-4BA2-8B90-6436B56EA157}
40 | EndGlobalSection
41 | EndGlobal
42 |
--------------------------------------------------------------------------------
/File Unlock/256X256.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Xing-Fax/File-Unlock/02797d826bf5b67f2e542a421284f0ae3b9948aa/File Unlock/256X256.ico
--------------------------------------------------------------------------------
/File Unlock/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/File Unlock/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/File Unlock/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Configuration;
5 | using System.Data;
6 | using System.Diagnostics;
7 | using System.Linq;
8 | using System.Reflection;
9 | using System.Security.Principal;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 |
13 | namespace File_Unlock
14 | {
15 | ///
16 | /// App.xaml 的交互逻辑
17 | ///
18 | public partial class App : Application
19 | {
20 | ///
21 | /// 用于存储已经添加的文件路径
22 | ///
23 | public static ArrayList Number_file = new ArrayList();
24 |
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/File Unlock/Delete_Class.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Runtime.InteropServices;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 | using IObitUnlocker.Wrapper;
11 |
12 | namespace File_Unlock
13 | {
14 | class Delete_Class
15 | {
16 | /////
17 | ///// 释放到嵌入程序中的资源文件
18 | /////
19 | ///// 资源文件字节组
20 | ///// 释放文件路径
21 | ///// 文件是否释放成功
22 | //public static bool file(byte[] byDll, string file)
23 | //{
24 | // using (FileStream fs = new FileStream(file, FileMode.Create))//开始写入文件流
25 | // fs.Write(byDll, 0, byDll.Length);
26 | // if (File.Exists(file))//检索文件是否正确被释放
27 | // return true;
28 | // else
29 | // return false;
30 | //}
31 |
32 | /////
33 | ///// 执行释放文件
34 | /////
35 | ///// 释放文件路径
36 | ///// 释放全部成功释放
37 | //public static bool File_List(string temp)
38 | //{
39 | // if (file(Properties.Resources.unlocker, temp + @"\File unlock library.exe"))
40 | // return true;
41 | // else
42 | // return false;
43 | //}
44 |
45 | /////
46 | ///// 调用其他控制台程序
47 | /////
48 | ///// 程序路径
49 | ///// 命令参数
50 | ///// 返回执行后输出结果
51 | //public static string Console(string file, string command)
52 | //{
53 | // Process p = new Process();
54 | // p.StartInfo.FileName = file; //确定程序名
55 | // p.StartInfo.Arguments = command; //确定程式命令行
56 | // p.StartInfo.UseShellExecute = false; //Shell的使用
57 | // p.StartInfo.RedirectStandardInput = true; //重定向输入
58 | // p.StartInfo.RedirectStandardOutput = true; //重定向输出
59 | // p.StartInfo.RedirectStandardError = true; //重定向输出错误
60 | // p.StartInfo.CreateNoWindow = true; //设置置不显示示窗口
61 | // p.Start();
62 | // return p.StandardOutput.ReadToEnd(); //输出出流取得命令行结果果
63 | //}
64 |
65 | ///
66 | /// 执行CMD命令
67 | ///
68 | /// 命令内容
69 | /// 返回执行后的输出结果
70 | public static string RunCmd(string command)
71 | {
72 | Process p = new Process();
73 | p.StartInfo.FileName = "cmd.exe"; //确定程序名
74 | p.StartInfo.Arguments = "/c " + command; //确定程式命令行
75 | p.StartInfo.UseShellExecute = false; //Shell的使用
76 | p.StartInfo.RedirectStandardInput = true; //重定向输入
77 | p.StartInfo.RedirectStandardOutput = true; //重定向输出
78 | p.StartInfo.RedirectStandardError = true; //重定向输出错误
79 | p.StartInfo.CreateNoWindow = true; //设置置不显示示窗口
80 | p.Start();
81 | return p.StandardOutput.ReadToEnd(); //输出出流取得命令行结果果
82 | }
83 |
84 | ///
85 | /// 通过更改所有权方式强制删除文件
86 | ///
87 | /// 要删除的文件路径
88 | /// 是否删除成功
89 | public static bool Force_delete(string path)
90 | {
91 | RunCmd("takeown /F " + "\"" + path + "\"" + " /A"); //将文件所有者设为管理员组
92 | RunCmd("icacls " + "\"" + path + "\"" + " /grant Administrators:F"); //取得文件所有控制权
93 | RunCmd("del " + "\"" + path + "\""); //删除文件
94 | if (!File.Exists(path)) //判断是否删除成功
95 | return true;
96 | return false;
97 | }
98 |
99 | ///
100 | /// 对文件进行解锁操作
101 | ///
102 | ///
103 | /// 是否执行成功
104 | public static bool Unlock_file(string Path_file)
105 | {
106 | try
107 | {
108 | //string temp = Environment.GetEnvironmentVariable("TMP"); //得到用户临时文件夹路径
109 |
110 | var file = Path.Combine(Directory.GetCurrentDirectory(), Path_file);
111 |
112 | IObitController.UnlockFile(file, FileOperation.Unlock);
113 |
114 | //Console(temp + @"\File unlock library.exe", "\"" + path + "\""); //调用库文件进行解锁操作
115 | return true;
116 | }
117 | catch //遇到错误返回解锁失败
118 | {
119 | return false;
120 | }
121 | }
122 |
123 | ///
124 | /// 读取流方式来复制文件
125 | ///
126 | /// 原始文件路径
127 | /// 复制目标文件路径
128 | /// true复制成功,false复制失败
129 | public static bool CopyFile(string soucrePath, string targetPath)
130 | {
131 | try
132 | {
133 | //读取复制文件流
134 | using (FileStream fsRead = new FileStream(soucrePath, FileMode.Open, FileAccess.Read))
135 | {
136 | //写入文件复制流
137 | using (FileStream fsWrite = new FileStream(targetPath, FileMode.OpenOrCreate, FileAccess.Write))
138 | {
139 | byte[] buffer = new byte[1024 * 1024 * 2]; //每次读取2M
140 |
141 | while (true) //可能文件比较大,要循环读取,每次读取2M
142 | {
143 | int n = fsRead.Read(buffer, 0, buffer.Count()); //每次读取的数据 n:是每次读取到的实际数据大小
144 | if (n == 0) //如果n=0说明读取的数据为空,已经读取到最后了,跳出循环
145 | break;
146 | fsWrite.Write(buffer, 0, n); //写入每次读取的实际数据大小
147 | }
148 | }
149 | }
150 | return true;
151 | }
152 | catch
153 | {
154 | return false;
155 | }
156 | }
157 |
158 | [DllImport("kernel32.dll")]
159 | public static extern IntPtr _lopen(string lpPathName, int iReadWrite);
160 |
161 | [DllImport("kernel32.dll")]
162 | public static extern bool CloseHandle(IntPtr hObject);
163 |
164 | public const int OF_READWRITE = 2;
165 | public const int OF_SHARE_DENY_NONE = 0x40;
166 | public static readonly IntPtr HFILE_ERROR = new IntPtr(-1);
167 |
168 | ///
169 | /// 判断文件是否被其他程序占用
170 | ///
171 | ///
172 | /// true为占用,false为没有占用
173 | public static bool Judgment_status(string path)
174 | {
175 | IntPtr vHandle = _lopen(path, OF_READWRITE | OF_SHARE_DENY_NONE);
176 | if (vHandle == HFILE_ERROR)
177 | { //占用
178 | return true;
179 | }
180 | CloseHandle(vHandle);
181 | //没有占用
182 | return false;
183 | }
184 | }
185 | }
186 |
--------------------------------------------------------------------------------
/File Unlock/Drag_and_drop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Forms;
9 |
10 | namespace File_Unlock
11 | {
12 | public class Drag_and_drop
13 | {
14 | public sealed class FileDropHandler : IMessageFilter, IDisposable
15 | {
16 |
17 | #region native members
18 |
19 | [DllImport("user32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
20 | [return: MarshalAs(UnmanagedType.Bool)]
21 | private static extern bool ChangeWindowMessageFilterEx(IntPtr hWnd, uint message, ChangeFilterAction action, in ChangeFilterStruct pChangeFilterStruct);
22 |
23 | [DllImport("shell32.dll", SetLastError = false, CallingConvention = CallingConvention.Winapi)]
24 | private static extern void DragAcceptFiles(IntPtr hWnd, bool fAccept);
25 |
26 | [DllImport("shell32.dll", SetLastError = false, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
27 | private static extern uint DragQueryFile(IntPtr hWnd, uint iFile, StringBuilder lpszFile, int cch);
28 |
29 | [DllImport("shell32.dll", SetLastError = false, CallingConvention = CallingConvention.Winapi)]
30 | private static extern void DragFinish(IntPtr hDrop);
31 |
32 | [StructLayout(LayoutKind.Sequential)]
33 | private struct ChangeFilterStruct
34 | {
35 | public uint CbSize;
36 | public ChangeFilterStatu ExtStatus;
37 | }
38 |
39 | private enum ChangeFilterAction : uint
40 | {
41 | MSGFLT_RESET,
42 | MSGFLT_ALLOW,
43 | MSGFLT_DISALLOW
44 | }
45 |
46 | private enum ChangeFilterStatu : uint
47 | {
48 | MSGFLTINFO_NONE,
49 | MSGFLTINFO_ALREADYALLOWED_FORWND,
50 | MSGFLTINFO_ALREADYDISALLOWED_FORWND,
51 | MSGFLTINFO_ALLOWED_HIGHER
52 | }
53 |
54 | private const uint WM_COPYGLOBALDATA = 0x0049;
55 | private const uint WM_COPYDATA = 0x004A;
56 | private const uint WM_DROPFILES = 0x0233;
57 |
58 | #endregion
59 |
60 |
61 | private const uint GetIndexCount = 0xFFFFFFFFU;
62 |
63 | private Control _ContainerControl;
64 |
65 | private readonly bool _DisposeControl;
66 |
67 | public Control ContainerControl { get; }
68 |
69 | public FileDropHandler(Control containerControl) : this(containerControl, false) { }
70 |
71 | public FileDropHandler(Control containerControl, bool releaseControl)
72 | {
73 | _ContainerControl = containerControl ?? throw new ArgumentNullException("control", "control is null.");
74 |
75 | if (containerControl.IsDisposed) throw new ObjectDisposedException("control");
76 |
77 | _DisposeControl = releaseControl;
78 |
79 | var status = new ChangeFilterStruct() { CbSize = 8 };
80 |
81 | if (!ChangeWindowMessageFilterEx(containerControl.Handle, WM_DROPFILES, ChangeFilterAction.MSGFLT_ALLOW, in status)) throw new Win32Exception(Marshal.GetLastWin32Error());
82 | if (!ChangeWindowMessageFilterEx(containerControl.Handle, WM_COPYGLOBALDATA, ChangeFilterAction.MSGFLT_ALLOW, in status)) throw new Win32Exception(Marshal.GetLastWin32Error());
83 | if (!ChangeWindowMessageFilterEx(containerControl.Handle, WM_COPYDATA, ChangeFilterAction.MSGFLT_ALLOW, in status)) throw new Win32Exception(Marshal.GetLastWin32Error());
84 | DragAcceptFiles(containerControl.Handle, true);
85 |
86 | Application.AddMessageFilter(this);
87 | }
88 |
89 | public bool PreFilterMessage(ref Message m)
90 | {
91 | if (_ContainerControl == null || _ContainerControl.IsDisposed) return false;
92 | if (_ContainerControl.AllowDrop) return _ContainerControl.AllowDrop = false;
93 | if (m.Msg == WM_DROPFILES)
94 | {
95 | var handle = m.WParam;
96 |
97 | var fileCount = DragQueryFile(handle, GetIndexCount, null, 0);
98 |
99 | var fileNames = new string[fileCount];
100 |
101 | var sb = new StringBuilder(262);
102 | var charLength = sb.Capacity;
103 | for (uint i = 0; i < fileCount; i++)
104 | {
105 | if (DragQueryFile(handle, i, sb, charLength) > 0) fileNames[i] = sb.ToString();
106 | }
107 | DragFinish(handle);
108 | _ContainerControl.AllowDrop = true;
109 | _ContainerControl.DoDragDrop(fileNames, DragDropEffects.All);
110 | _ContainerControl.AllowDrop = false;
111 | return true;
112 | }
113 | return false;
114 | }
115 |
116 | public void Dispose()
117 | {
118 | if (_ContainerControl == null)
119 | {
120 | if (_DisposeControl && !_ContainerControl.IsDisposed) _ContainerControl.Dispose();
121 | Application.RemoveMessageFilter(this);
122 | _ContainerControl = null;
123 | }
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/File Unlock/File Unlock.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {B29290B0-6C48-4E0B-986D-72B6074FC8A3}
8 | WinExe
9 | File_Unlock
10 | File Unlock Pro
11 | v4.7.2
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | true
17 |
18 |
19 |
20 |
21 | AnyCPU
22 | true
23 | full
24 | false
25 | bin\Debug\
26 | DEBUG;TRACE
27 | prompt
28 | 4
29 |
30 |
31 | x86
32 | pdbonly
33 | true
34 | bin\Release\
35 | TRACE
36 | prompt
37 | 4
38 |
39 |
40 | 256X256.ico
41 |
42 |
43 | LocalIntranet
44 |
45 |
46 | false
47 |
48 |
49 | Properties\app.manifest
50 |
51 |
52 |
53 |
54 | ..\packages\MaterialDesignColors.2.0.1\lib\net452\MaterialDesignColors.dll
55 |
56 |
57 | ..\packages\MaterialDesignThemes.4.1.0\lib\net452\MaterialDesignThemes.Wpf.dll
58 |
59 |
60 | ..\packages\Microsoft-WindowsAPICodePack-Core.1.1.4\lib\net472\Microsoft.WindowsAPICodePack.dll
61 |
62 |
63 | ..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.4\lib\net472\Microsoft.WindowsAPICodePack.Shell.dll
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | 4.0
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | MSBuild:Compile
86 | Designer
87 |
88 |
89 | MSBuild:Compile
90 | Designer
91 |
92 |
93 | App.xaml
94 | Code
95 |
96 |
97 |
98 |
99 | MainWindow.xaml
100 | Code
101 |
102 |
103 |
104 |
105 |
106 | Code
107 |
108 |
109 | True
110 | True
111 | Resources.resx
112 |
113 |
114 | True
115 | Settings.settings
116 | True
117 |
118 |
119 | ResXFileCodeGenerator
120 | Resources.Designer.cs
121 |
122 |
123 |
124 |
125 |
126 | SettingsSingleFileGenerator
127 | Settings.Designer.cs
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | {fa5efada-e935-4dd8-89ae-2f657b311b77}
139 | IObitUnlocker.Wrapper
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
150 |
151 |
152 |
153 |
--------------------------------------------------------------------------------
/File Unlock/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
112 |
113 |
122 |
130 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
175 |
176 |
177 |
178 |
179 |
--------------------------------------------------------------------------------
/File Unlock/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using IObitUnlocker.Wrapper;
2 | using Microsoft.Win32;
3 | using Microsoft.WindowsAPICodePack.Dialogs;
4 | using System;
5 | using System.Collections;
6 | using System.Collections.Generic;
7 | using System.Diagnostics;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Reflection;
11 | using System.Security.Principal;
12 | using System.Text;
13 | using System.Threading.Tasks;
14 | using System.Windows;
15 | using System.Windows.Controls;
16 | using System.Windows.Data;
17 | using System.Windows.Documents;
18 | using System.Windows.Input;
19 | using System.Windows.Media;
20 | using System.Windows.Media.Animation;
21 | using System.Windows.Media.Imaging;
22 | using System.Windows.Navigation;
23 | using System.Windows.Shapes;
24 | using static File_Unlock.Drag_and_drop;
25 |
26 | namespace File_Unlock
27 | {
28 | ///
29 | /// MainWindow.xaml 的交互逻辑
30 | ///
31 | public partial class MainWindow : Window
32 | {
33 | public FileDropHandler FileDroper; //全局的
34 | static string Out_file = string.Empty;
35 | public MainWindow()
36 | {
37 | InitializeComponent();
38 |
39 | if (check.Document_verification() != true)
40 | {
41 | MessageBox.Show("签名校验失败,程序可能被篡改,轻击确定以退出程序", "警告");
42 | Environment.Exit(0);
43 | }
44 | //FileDroper = new FileDropHandler(); //初始化
45 | 日志.Text += "[" + DateTime.Now.ToLongTimeString().ToString() + "]: 程序启动... Copyright © xcz 2021";
46 | Log("程序已经准备就绪!");
47 | }
48 |
49 | private void 开始_Click(object sender, RoutedEventArgs e)
50 | {
51 | if(App.Number_file.Count != 0)
52 | {
53 | if ((bool)操作3.IsChecked || (bool)操作4.IsChecked)
54 | {
55 | if (Out_file != string.Empty)
56 | {
57 | Perform_Operation.Operation(App.Number_file, Out_file, this);
58 | }
59 | else
60 | {
61 | Log("请选择目标文件夹!");
62 | }
63 | }
64 | else
65 | {
66 | Perform_Operation.Operation(App.Number_file, Out_file, this);
67 | }
68 | }
69 | else
70 | {
71 | Log("请添加要操作的文件!");
72 | }
73 | }
74 |
75 | public void Log(string str)
76 | {
77 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: " + str;
78 | 框.ScrollToVerticalOffset(框.ExtentHeight);
79 | }
80 |
81 | private void 关闭_Click(object sender, RoutedEventArgs e)
82 | {
83 | Environment.Exit(0); //关闭程序
84 | }
85 |
86 | private void 选择路径_Click(object sender, RoutedEventArgs e)
87 | {
88 | try
89 | {
90 | var dialog = new CommonOpenFileDialog();
91 | dialog.IsFolderPicker = true;
92 | CommonFileDialogResult result = dialog.ShowDialog();
93 | if (dialog.FileName != "")
94 | {
95 | 输出路径.Text = dialog.FileName;
96 | Out_file = dialog.FileName;
97 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: 重新定向输出文件夹:" + dialog.FileName;
98 | }
99 | }
100 | catch { }
101 | }
102 |
103 | private void 添加文件_Click(object sender, RoutedEventArgs e)
104 | {
105 | OpenFileDialog ofd = new OpenFileDialog();
106 | ofd.Filter = "全部文件|*.*";
107 | ofd.Multiselect = true;
108 | if (ofd.ShowDialog(this) == true)
109 | {
110 | foreach (string file in ofd.FileNames)
111 | {
112 | if (App.Number_file.Contains(file) == false)//排除同类项
113 | {
114 | App.Number_file.Add(file);//将元素添加到数组末尾
115 | 文件列表.Items.Add(file);
116 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: 已添加文件:" + file;
117 | 框.ScrollToVerticalOffset(框.ExtentHeight);
118 | }
119 | else
120 | {
121 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: 添加失败!原因:已存在此文件";
122 | }
123 | }
124 | }
125 | 文件下拉框.Header = "已选择" + App.Number_file.Count + "个对象";
126 | }
127 |
128 | private void 打开目录_Click(object sender, RoutedEventArgs e)
129 | {
130 | if(Out_file != string.Empty)
131 | {
132 | if (Directory.Exists(Out_file)) //判断输出路径是否存在
133 | {
134 | Delete_Class.RunCmd("explorer " + Out_file + @"\");
135 | }
136 | else //如果不在重新创建
137 | {
138 | Log("重新创建输出目录...");
139 | Directory.CreateDirectory(Out_file);//创建新路径
140 | Delete_Class.RunCmd("explorer " + Out_file + @"\");
141 | }
142 | }
143 | else
144 | {
145 | Log("您还没有选择输出目录!");
146 | }
147 | }
148 |
149 | private void 拖入文件_Drop(object sender, DragEventArgs e)
150 | {
151 | 拖入文件.Visibility = Visibility.Collapsed;
152 | string[] filePath = (string[])e.Data.GetData(DataFormats.FileDrop);
153 | for (int i = 0; i < filePath.Length; i++)
154 | {
155 | if (App.Number_file.Contains(filePath[i]) == false)//排除同类项
156 | {
157 | App.Number_file.Add(filePath[i]);//将元素添加到数组末尾
158 | 文件列表.Items.Add(filePath[i]);
159 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: 已添加文件:" + filePath[i];
160 | }
161 | else
162 | {
163 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: 添加失败!原因:已存在此文件";
164 | }
165 | }
166 | 文件下拉框.Header = "已选择" + App.Number_file.Count + "个对象";
167 | }
168 |
169 | private void 清空对象_Click(object sender, RoutedEventArgs e)
170 | {
171 | App.Number_file.Clear();
172 | 文件列表.Items.Clear();
173 | 文件下拉框.Header = "已选择0个对象";
174 | 日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: 已清空文件列表";
175 | }
176 |
177 | private void 标题_MouseMove(object sender, MouseEventArgs e)
178 | {
179 | if (e.LeftButton == MouseButtonState.Pressed) { DragMove(); }
180 | }
181 |
182 | private void 最小化_Click(object sender, RoutedEventArgs e)
183 | {
184 | this.WindowState = WindowState.Minimized;
185 | }
186 |
187 | private void 关于_Click(object sender, RoutedEventArgs e)
188 | {
189 | BeginStoryboard((Storyboard)FindResource("打开"));
190 | }
191 |
192 | private void ToggleButton_Click(object sender, RoutedEventArgs e)
193 | {
194 | this.Topmost = (bool)前端显示.IsChecked;
195 | }
196 |
197 | private void 清除日志_Click(object sender, RoutedEventArgs e)
198 | {
199 | 日志.Text = "[" + DateTime.Now.ToLongTimeString().ToString() + "]: 已经清空日志...";
200 | }
201 |
202 | private void RadioButton_Checked(object sender, RoutedEventArgs e)
203 | {
204 | 输出路径.IsEnabled = false;
205 | }
206 |
207 | private void RadioButton_Checked_1(object sender, RoutedEventArgs e)
208 | {
209 | 输出路径.IsEnabled = false;
210 | }
211 |
212 | private void RadioButton_Checked_2(object sender, RoutedEventArgs e)
213 | {
214 | 输出路径.IsEnabled = true;
215 | }
216 |
217 | private void RadioButton_Checked_3(object sender, RoutedEventArgs e)
218 | {
219 | 输出路径.IsEnabled = true;
220 | }
221 |
222 | private void 关闭关于_Click(object sender, RoutedEventArgs e)
223 | {
224 | BeginStoryboard((Storyboard)FindResource("关闭"));
225 | }
226 |
227 | private void 图标_MouseUp(object sender, MouseButtonEventArgs e)
228 | {
229 | Process.Start("https://github.com/xingchuanzhen/File-Unlock");
230 | }
231 |
232 | private void Window_DragEnter(object sender, DragEventArgs e)
233 | {
234 | 拖入文件.Visibility = Visibility.Visible;
235 | }
236 |
237 | private void Window_DragLeave(object sender, DragEventArgs e)
238 | {
239 | 拖入文件.Visibility = Visibility.Collapsed;
240 | }
241 | }
242 | }
243 |
--------------------------------------------------------------------------------
/File Unlock/Perform_Operation.cs:
--------------------------------------------------------------------------------
1 | using IObitUnlocker.Wrapper;
2 | using System;
3 | using System.Collections;
4 | using System.ComponentModel;
5 | using System.IO;
6 | using System.Threading;
7 | using System.Windows;
8 | using System.Windows.Threading;
9 |
10 | namespace File_Unlock
11 | {
12 | class Perform_Operation
13 | {
14 | private static void Log(string str)
15 | {
16 | new Thread(() =>//异步调用
17 | {
18 | Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
19 | new Action(() =>
20 | {
21 | window.日志.Text += "\n[" + DateTime.Now.ToLongTimeString().ToString() + "]: " + str;
22 | window.框.ScrollToVerticalOffset(window.框.ExtentHeight);
23 | }));
24 | }).Start();
25 | }
26 |
27 | static ArrayList Number_file;
28 | static string Out_file;
29 | static MainWindow window;
30 | static bool Compulsory = false;
31 | private static void Background_execution(object sender, DoWorkEventArgs e)
32 | {
33 | IObitController.DriverStart(); //加载驱动
34 | for (int i = 0;i < Number_file.Count;i ++)
35 | {
36 | if(File.Exists(Number_file[i].ToString()))
37 | {
38 | bool Fail = false; //决定是否解锁成功
39 | //解锁文件操作
40 | //判断文件是否被锁定
41 | if (Delete_Class.Judgment_status(Number_file[i].ToString()) || Compulsory)
42 | {
43 |
44 | if (Delete_Class.Unlock_file(Number_file[i].ToString())) //进行解锁文件
45 | {
46 | if(!Delete_Class.Judgment_status(Number_file[i].ToString()))
47 | {
48 | Log("解锁文件:" + Path.GetFileName(Number_file[i].ToString()) + " 解锁成功!");
49 | Fail = true;
50 | }
51 | else
52 | {
53 | Log("解锁文件:" + Path.GetFileName(Number_file[i].ToString()) + " 解锁失败!");
54 | }
55 | }
56 | else
57 | {
58 | Log("解锁文件:" + Path.GetFileName(Number_file[i].ToString()) + " 解锁失败!");
59 | }
60 | }
61 | else
62 | {
63 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 没有锁定!");
64 | Fail = true;
65 | }
66 |
67 | if ((e.Argument.ToString() == "3" || e.Argument.ToString() == "4") && Fail == true)
68 | {
69 |
70 | if (Delete_Class.CopyFile(Number_file[i].ToString(), Out_file + @"\" + Path.GetFileName(Number_file[i].ToString())))
71 | {
72 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 复制成功!");
73 | Fail = false;
74 | }
75 | else
76 | {
77 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 复制失败!");
78 | }
79 | }
80 |
81 | //删除文件操作
82 | if (e.Argument.ToString() == "2" || e.Argument.ToString() == "3" && Fail == false)
83 | {
84 | Delete_Class.RunCmd("del " + "\"" + Number_file[i].ToString() + "\"");
85 |
86 | if (File .Exists(Number_file[i].ToString()))//判断文件是删除成功,否则采用强制删除
87 | {
88 | if (Delete_Class.Force_delete(Number_file[i].ToString()))
89 | {
90 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 强制删除成功!");
91 | }
92 | else
93 | {
94 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 强制删除失败!");
95 | }
96 | }
97 | else
98 | {
99 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 删除成功!");
100 | }
101 | }
102 | }
103 | else
104 | {
105 | Log("文件:" + Path.GetFileName(Number_file[i].ToString()) + " 不存在!");
106 | }
107 | }
108 |
109 | Log("一共" + Number_file.Count.ToString() + " 个文件执行完毕!");
110 | IObitController.DriverStop(); //释放驱动
111 | IObitController.DriverClose(); //释放资源
112 | new Thread(() =>//异步调用
113 | {
114 | Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
115 | new Action(() =>
116 | {
117 | window.进度条.IsIndeterminate = false;
118 | window.开始.IsEnabled = true;
119 | }));
120 | }).Start();
121 | }
122 |
123 |
124 | ///
125 | /// 开始执行操作
126 | ///
127 | /// 文件列表
128 | /// 输出目录
129 | /// 窗体对象
130 | public static void Operation(ArrayList Number_file0,string Out_file0,MainWindow main)
131 | {
132 | main.开始.IsEnabled = false;
133 |
134 | Number_file = Number_file0;
135 | Out_file = Out_file0;
136 | window = main;
137 |
138 | Compulsory = (bool)window.强制解锁.IsChecked;
139 |
140 | if ((bool)main.操作3.IsChecked || (bool)main.操作4.IsChecked)
141 | if (!File.Exists(Out_file)) //判断输出路径是否存在
142 | {
143 | Directory.CreateDirectory(Out_file);//创建新路径
144 | }
145 | int temp = 0;
146 | if ((bool)main.操作1.IsChecked)
147 | temp = 1;
148 |
149 | if ((bool)main.操作2.IsChecked)
150 | temp = 2;
151 |
152 | if ((bool)main.操作3.IsChecked)
153 | temp = 3;
154 |
155 | if ((bool)main.操作4.IsChecked)
156 | temp = 4;
157 |
158 | main.进度条.IsIndeterminate = true;
159 | using (BackgroundWorker bw = new BackgroundWorker())
160 | {
161 | bw.DoWork += new DoWorkEventHandler(Background_execution);
162 | bw.RunWorkerAsync(temp.ToString());
163 | }
164 | }
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/File Unlock/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // 有关程序集的一般信息由以下
8 | // 控制。更改这些特性值可修改
9 | // 与程序集关联的信息。
10 | [assembly: AssemblyTitle("File Unlock Pro")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("File Unlock Pro")]
15 | [assembly: AssemblyCopyright("Copyright ©xcz 2021")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // 将 ComVisible 设置为 false 会使此程序集中的类型
20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
21 | //请将此类型的 ComVisible 特性设置为 true。
22 | [assembly: ComVisible(false)]
23 |
24 | //若要开始生成可本地化的应用程序,请设置
25 | //.csproj 文件中的 CultureYouAreCodingWith
26 | //例如,如果您在源文件中使用的是美国英语,
27 | //使用的是美国英语,请将 设置为 en-US。 然后取消
28 | //对以下 NeutralResourceLanguage 特性的注释。 更新
29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置
36 | //(未在页面中找到资源时使用,
37 | //或应用程序资源字典中找到时使用)
38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
39 | //(未在页面中找到资源时使用,
40 | //、应用程序或任何主题专用资源字典中找到时使用)
41 | )]
42 |
43 |
44 | // 程序集的版本信息由下列四个值组成:
45 | //
46 | // 主版本
47 | // 次版本
48 | // 生成号
49 | // 修订号
50 | //
51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
52 | //通过使用 "*",如下所示:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("2.0.0.0")]
55 | [assembly: AssemblyFileVersion("2.0.0.0")]
56 |
--------------------------------------------------------------------------------
/File Unlock/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace File_Unlock.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("File_Unlock.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性,对
51 | /// 使用此强类型资源类的所有资源查找执行重写。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/File Unlock/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/File Unlock/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 |
12 | namespace File_Unlock.Properties
13 | {
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
17 | {
18 |
19 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
20 |
21 | public static Settings Default
22 | {
23 | get
24 | {
25 | return defaultInstance;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/File Unlock/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/File Unlock/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
47 |
54 |
55 |
69 |
--------------------------------------------------------------------------------
/File Unlock/check.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Security.Cryptography.X509Certificates;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace File_Unlock
10 | {
11 | class check
12 | {
13 | ///
14 | /// 检测自己身签名指纹是否匹配
15 | /// 有效防止软件被病毒或恶意软件篡改
16 | ///
17 | /// 返回true为正常状态
18 | public static bool Document_verification()
19 | {
20 | try
21 | {
22 | X509Certificate cert = X509Certificate.CreateFromSignedFile(Process.GetCurrentProcess().MainModule.FileName);
23 | string Fingerprint = cert.GetCertHashString();
24 | if (Fingerprint == "36A888B9F2A505BF92AC6B2796C2188E639AB1D1")
25 | { return true; }
26 | else
27 | { return false; }
28 | }
29 | catch { return false; }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/File Unlock/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/FileOperation.cs:
--------------------------------------------------------------------------------
1 | namespace IObitUnlocker.Wrapper
2 | {
3 | public enum FileOperation
4 | {
5 | Unlock = 0,
6 | UnlockAndDelete = 1
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/IObitController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Runtime.InteropServices;
4 |
5 | namespace IObitUnlocker.Wrapper
6 | {
7 | public static class IObitController
8 | {
9 | static bool init = false;
10 |
11 | static string SysPath = Path.Combine(Directory.GetCurrentDirectory(), "IObitUnlocker.sys");
12 |
13 | static string DLLPath = Path.Combine(Directory.GetCurrentDirectory(), "IObitUnlocker.dll");
14 |
15 | public static void Init()
16 | {
17 | //写入文件
18 | File.WriteAllBytes(DLLPath, Properties.Resources.IObitUnlocker);
19 |
20 | File.WriteAllBytes(SysPath, Properties.Resources.IObitUnlockerSyS);
21 |
22 | //设置隐藏属性
23 | File.SetAttributes(DLLPath, FileAttributes.Hidden);
24 |
25 | File.SetAttributes(SysPath, FileAttributes.Hidden);
26 |
27 | init = true;
28 | }
29 |
30 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
31 | delegate bool IObitDriverBase();
32 |
33 | [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Unicode)]
34 | delegate int IObitDriverUnlockFile(string file, ref uint unk1, FileOperation deleteFile, int unk2, out int unk3);
35 |
36 | static int handle; //保存dll句柄
37 | public static bool DriverStart()
38 | {
39 | Init();
40 | handle = (int)Native.LoadLibraryEx(DLLPath, IntPtr.Zero, LoadLibraryFlags.None);
41 | var addr = Native.GetProcAddress((IntPtr)handle, "DriverStart");
42 | var DriverStart = Marshal.GetDelegateForFunctionPointer(addr);
43 | return DriverStart();
44 | }
45 |
46 | public static bool DriverStop()
47 | {
48 | var addr = Native.GetProcAddress((IntPtr)handle, "DriverStop");
49 | var DriverStop = Marshal.GetDelegateForFunctionPointer(addr);
50 | return DriverStop();
51 | }
52 |
53 | public static void DriverClose()
54 | {
55 | while (Native.FreeLibrary(handle) != 0); //通过句柄释放dll
56 | //删除文件
57 | if (File.Exists(SysPath))
58 | File.Delete(SysPath);
59 | if (File.Exists(DLLPath))
60 | File.Delete(DLLPath);
61 | }
62 |
63 | public static int UnlockFile(string file, FileOperation operation)
64 | {
65 | if (!init)
66 | {
67 | Init();
68 | }
69 | var dll = Native.LoadLibraryEx(DLLPath, IntPtr.Zero, LoadLibraryFlags.None);
70 | var addr = Native.GetProcAddress(dll, "DriverUnlockFile");
71 | var DriverUnlockFile = Marshal.GetDelegateForFunctionPointer(addr);
72 | uint flag = 0xc08b0000;
73 | return DriverUnlockFile(file, ref flag, operation, 0, out int unk3);
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/IObitUnlocker.Wrapper.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {FA5EFADA-E935-4DD8-89AE-2F657B311B77}
8 | Library
9 | Properties
10 | IObitUnlocker.Wrapper
11 | IObitUnlocker.Wrapper
12 | v4.7.2
13 | 512
14 | true
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 | x86
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | True
51 | True
52 | Resources.resx
53 |
54 |
55 |
56 |
57 | ResXFileCodeGenerator
58 | Resources.Designer.cs
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/Native.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace IObitUnlocker.Wrapper
5 | {
6 | [Flags]
7 | public enum LoadLibraryFlags : uint
8 | {
9 | None = 0
10 | }
11 | internal static class Native
12 | {
13 |
14 | [DllImport("kernel32.dll")]
15 | public static extern uint GetLastError();
16 |
17 | [DllImport("Kernel32", EntryPoint = "FreeLibrary", SetLastError = true)]
18 | public static extern int FreeLibrary(int handle);
19 |
20 | [DllImport("kernel32.dll", SetLastError = true)]
21 | public static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hReservedNull, LoadLibraryFlags dwFlags);
22 |
23 | [DllImport("kernel32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
24 | public static extern IntPtr GetProcAddress(IntPtr hModule, string exportname);
25 |
26 | [DllImport("kernel32.dll", SetLastError = true)]
27 | [return: MarshalAs(UnmanagedType.Bool)]
28 | public static extern bool FreeLibrary(IntPtr hModule);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("IObitControllerAPI")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("IObitControllerAPI")]
12 | [assembly: AssemblyCopyright("Copyright © 2020")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("fa5efada-e935-4dd8-89ae-2f657b311b77")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace IObitUnlocker.Wrapper.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IObitUnlocker.Wrapper.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Byte[].
65 | ///
66 | internal static byte[] IObitUnlocker {
67 | get {
68 | object obj = ResourceManager.GetObject("IObitUnlocker", resourceCulture);
69 | return ((byte[])(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Byte[].
75 | ///
76 | internal static byte[] IObitUnlockerSyS {
77 | get {
78 | object obj = ResourceManager.GetObject("IObitUnlockerSyS", resourceCulture);
79 | return ((byte[])(obj));
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\IObitUnlocker.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | ..\Resources\IObitUnlocker.sys;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/Resources/IObitUnlocker.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Xing-Fax/File-Unlock/02797d826bf5b67f2e542a421284f0ae3b9948aa/IObitUnlocker.Wrapper/Resources/IObitUnlocker.dll
--------------------------------------------------------------------------------
/IObitUnlocker.Wrapper/Resources/IObitUnlocker.sys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Xing-Fax/File-Unlock/02797d826bf5b67f2e542a421284f0ae3b9948aa/IObitUnlocker.Wrapper/Resources/IObitUnlocker.sys
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 XCZ
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # File-Unlock
2 |
3 | ## 项目介绍
4 |
5 | 此项目使用C#语言,基于NET4.7.2开发,用来解锁哪些被占用的文件
6 |
7 | ## 它可以干什么?
8 |
9 | 1.解锁那些被占用无法删除的文件
10 |
11 | 2.可以删除那些需要系统最高权限占用的文件
12 |
13 | 3.可以自由地解锁、删除、复制、移动文件
14 |
15 | ## 我该如何使用它?
16 |
17 | 1.打开程序,选择你要添加的被锁定的文件
18 |
19 | 2.选择要执行的操作
20 |
21 | 3.选择目标路径(如果想要移动或复制文件时)
22 |
23 | 4.单击右下角的“开始执行”按钮,等待显示执行完毕即可
24 |
25 | ## 我要从哪里下载它?
26 |
27 | 1.可以通过克隆源码到本地,进行编译后使用
28 |
29 | 2.在Github上的[发布页面](https://github.com/xingchuanzhen/File-Unlock/releases)下载可执行文件或源码
30 |
31 | 3.点击我提供的下载链接进行下载
32 |
33 | ## 声明
34 |
35 | 此项目核心文件采用了第三方IObit Unlocker的驱动文件在项目中引用了其“IObitUnlocker.dll”,“IObitUnlocker.sys”文件,核心代码并没有在项目中列出请须知
36 |
37 | ## 最后
38 |
39 | 软件下载链接:https://wwe.lanzoui.com/b01olbszg 密码:7f7s
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------