Win11系统提示找不到System.Security.Cryptography.Algorithms.dll文件的解决办法

其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个System.Security.Cryptography.Algorithms.dll文件(挑选合适的版本文件)把它放入到程序或系统目录中,当我们执行某一个.exe程序时,相应的DLL文件就会被调用,因此将缺失的文件放回到原目录之后就能打开你的软件或游戏了.

那么出现System.Security.Cryptography.Algorithms.dll丢失要怎么解决?

一、手动从网站下载单个dll文件

1、从下面列表下载System.Security.Cryptography.Algorithms.dll文件
32/64位 文件:
System.Security.Cryptography.Algorithms.dll

2、将下载的文件放入到你要运行的软件或者游戏的安装所在文件夹之中,可以右键点击主执行程序.exe然后选择"打开文件所在的位置" 找到安装目录,将文件复制进去。


或者将文件复制到Windows系统目录,这个需要注意电脑的系统是32位还是64位,如果是32位的系统,那就将本站下载32位的dll文件放到“C:/Windows/System32”这个文件夹里面,如果是64位的系统,那就将本站下载的32位dll文件放到“C:/Windows/SysWOW64”这个文件夹里面,本站下载的64位文件放到“C:/Windows/System32”这个文件夹里面.
 


如果问题依然无法解决,值得注意的是此类文件的丢失有时候和杀毒软件的误报毒有关,所以请将此类dll文件添加到杀毒软件的信任列表当中.
 

二、使用DLLEscort软件进行自动修复

DLLEscort软件能够修复解决常见的Windows系统文件与系统所需的大部分运行库,它可以帮助您一键修复系统软件或游戏丢失的DLL运行库文件,节省您的宝贵时间。 如果是因为缺少了运行库 导致的提示文件找不到错误 通常当你单独下载了一个文件放入到目录后,程序可能还会立即提示又丢失了另外一个文件,所以建议大家使用DLLEscort软件一键修复解决系统缺少运行库的问题,软件可随Windows系统长久的使用,每次重新安装系统后也可以使用它修复一次,以保障各软件或游戏在此后的平稳运行. 软件能够修复常见的Windows系统dll文件; DirectX游戏运行库; Microsoft Visual C++运行库; 其它常用运行库等.

DLLEscort软件支持32/64位 Windows XP,Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 操作系统,Windows 11 操作系统及服务器版Windows系统
下载地址:本站下载下载完成后得到安装包文件运行后,点击Next下一步进行安装,安装完毕后会自动打开软件或手动执行桌面主程序(DLLEscort)即可打开软件,

一、点击 "扫描系统" --> "扫描" 开始对系统所需文件扫描


 


 

二、扫描完成,扫描结果分成三部分,包括1,待修复的丢失文件。 2,待修复的注册表。 3.待清理的系统缓存文件。


 

三、点击”修复全部”修复开始,请保持网络正常,直到所有问题修复完成。

折叠全部 展开全部 Win-10.0.22621.0 Quicker-1.44.13.0 动作ID:29c6dfe2-10d8-4391-9753-a695f715e57a 来源动作: v0 Log文件路径:C:\Users\Administrator\AppData\Local\Temp\quicker_121_100918-555_log.html 定位文件 复制文件 上传并复制网址 开始执行动作:121 2025-07-04 22:09:18 6动作初始化 - + 60运行C#代码 [in]失败后停止【值/表达式】True [in]运行模式【值/表达式】normal_roslyn [in]脚本内容【值/表达式】using System;\r\n using System.Collections.Generic;\r\n using System.Windows.Automation;\r\n \r\n public static class WeChatHelper\r\n {\r\n public static string Exec(Quicker.Public.IStepContext context)\r\n {\r\n IntPtr hwnd = new IntPtr(68326); // 微信窗口句柄\r\n \r\n AutomationElement root = AutomationElement.FromHandle(hwnd);\r\n \r\n if (root == null)\r\n {\r\n return "无法获取微信窗口的自动化对象";\r\n }\r\n \r\n Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text);\r\n AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition);\r\n \r\n List<string> contactNames = new List<string>();\r\n \r\n foreach (AutomationElement element in texts)\r\n {\r\n string name = element.Current.Name.Trim();\r\n if (!string.IsNullOrEmpty(name) && IsValidContactName(name))\r\n {\r\n contactNames.Add(name);\r\n }\r\n }\r\n \r\n string result = string.Join("\n", contactNames);\r\n context.SetVarValue("contactNames", result); // 设置到变量 %contactNames%\r\n \r\n return $"成功识别 {contactNames.Count} 个好友昵称";\r\n }\r\n \r\n private static bool IsValidContactName(string text)\r\n {\r\n if (text.Length < 2 || text.Length > 20) return false;\r\n foreach (char c in text)\r\n {\r\n if (!(char.IsLetterOrDigit(c) || IsChineseChar(c)))\r\n return false;\r\n }\r\n return true;\r\n }\r\n \r\n private static bool IsChineseChar(char c)\r\n {\r\n return c >= 0x4E00 && c <= 0x9FFF;\r\n }\r\n }\r\n [in]执行线程【值/表达式】ui [in]引用DLL库【值/表达式】System.Windows.Automation.dll\r\n UIAutomationTypes.dll\r\n UIAutomationProvider.dll 异常:编译失败, Compilation, (31,9): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) (31,34): error CS0103: The name 'AutomationElement' does not exist in the current context (38,9): error CS0246: The type or namespace name 'Condition' could not be found (are you missing a using directive or an assembly reference?) (38,35): error CS0246: The type or namespace name 'PropertyCondition' could not be found (are you missing a using directive or an assembly reference?) (38,53): error CS0103: The name 'AutomationElement' does not exist in the current context (39,9): error CS0246: The type or namespace name 'AutomationElementCollection' could not be found (are you missing a using directive or an assembly reference?) (43,18): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Windows.Automation; 14. 15. namespace __ScriptExecution { 16. 17. public class __zpdv9689 18. { 19. 20. 21. // using System; 22. // using System.Collections.Generic; 23. // using System.Windows.Automation; 24. 25. public static class WeChatHelper 26. { 27. public static string Exec(Quicker.Public.IStepContext context) 28. { 29. IntPtr hwnd = new IntPtr(68326); // 微信窗口句柄 30. 31. AutomationElement root = AutomationElement.FromHandle(hwnd); 32. 33. if (root == null) 34. { 35. return "无法获取微信窗口的自动化对象"; 36. } 37. 38. Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text); 39. AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition); 40. 41. List<string> contactNames = new List<string>(); 42. 43. foreach (AutomationElement element in texts) 44. { 45. string name = element.Current.Name.Trim(); 46. if (!string.IsNullOrEmpty(name) && IsValidContactName(name)) 47. { 48. contactNames.Add(name); 49. } 50. } 51. 52. string result = string.Join("\n", contactNames); 53. context.SetVarValue("contactNames", result); // 设置到变量 %contactNames% 54. 55. return $"成功识别 {contactNames.Count} 个好友昵称"; 56. } 57. 58. private static bool IsValidContactName(string text) 59. { 60. if (text.Length < 2 || text.Length > 20) return false; 61. foreach (char c in text) 62. { 63. if (!(char.IsLetterOrDigit(c) || IsChineseChar(c))) 64. return false; 65. } 66. return true; 67. } 68. 69. private static bool IsChineseChar(char c) 70. { 71. return c >= 0x4E00 && c <= 0x9FFF; 72. } 73. } 74. 75. 76. 77. } 78. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Python.Runtime.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\Semver.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaCore.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuicker.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuickerTools.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaWin32.0.1.54.0.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_zh-Hans_b03f5f7f11d50a3a\System.Net.Http.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 在 rTc1KTvzg91oKUEE8r7.TjNcIivIvOgHbN6UMi2.EsrWRQiFgnX(String , String , String ) 在 rTc1KTvzg91oKUEE8r7.TjNcIivIvOgHbN6UMi2.dWDWRgENtHN(String , String , ActionExecuteContext ) 在 Quicker.Domain.Actions.X.BuiltinRunners.Other.RunCsScriptStep.r52t34kc9u4(ActionStep , ActionExecuteContext , XAction , String , ThreadType ) 在 Quicker.Domain.Actions.X.BuiltinRunners.Other.RunCsScriptStep.<>c__DisplayClass62_0.s39AhW2xkks() 在 Quicker.Domain.Actions.X.XActionHelper.ExecuteCommonAction(ActionExecuteContext context, ActionStep step, XAction action, Func`1 actionFunc, Action successAction, Action failAction, StepInParamDef stopIfErrorParam, StepOutParamDef isSuccessOutputParam) 步骤(sys:csscript)执行失败,原因:编译失败, Compilation, (31,9): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) (31,34): error CS0103: The name 'AutomationElement' does not exist in the current context (38,9): error CS0246: The type or namespace name 'Condition' could not be found (are you missing a using directive or an assembly reference?) (38,35): error CS0246: The type or namespace name 'PropertyCondition' could not be found (are you missing a using directive or an assembly reference?) (38,53): error CS0103: The name 'AutomationElement' does not exist in the current context (39,9): error CS0246: The type or namespace name 'AutomationElementCollection' could not be found (are you missing a using directive or an assembly reference?) (43,18): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Windows.Automation; 14. 15. namespace __ScriptExecution { 16. 17. public class __zpdv9689 18. { 19. 20. 21. // using System; 22. // using System.Collections.Generic; 23. // using System.Windows.Automation; 24. 25. public static class WeChatHelper 26. { 27. public static string Exec(Quicker.Public.IStepContext context) 28. { 29. IntPtr hwnd = new IntPtr(68326); // 微信窗口句柄 30. 31. AutomationElement root = AutomationElement.FromHandle(hwnd); 32. 33. if (root == null) 34. { 35. return "无法获取微信窗口的自动化对象"; 36. } 37. 38. Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text); 39. AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition); 40. 41. List<string> contactNames = new List<string>(); 42. 43. foreach (AutomationElement element in texts) 44. { 45. string name = element.Current.Name.Trim(); 46. if (!string.IsNullOrEmpty(name) && IsValidContactName(name)) 47. { 48. contactNames.Add(name); 49. } 50. } 51. 52. string result = string.Join("\n", contactNames); 53. context.SetVarValue("contactNames", result); // 设置到变量 %contactNames% 54. 55. return $"成功识别 {contactNames.Count} 个好友昵称"; 56. } 57. 58. private static bool IsValidContactName(string text) 59. { 60. if (text.Length < 2 || text.Length > 20) return false; 61. foreach (char c in text) 62. { 63. if (!(char.IsLetterOrDigit(c) || IsChineseChar(c))) 64. return false; 65. } 66. return true; 67. } 68. 69. private static bool IsChineseChar(char c) 70. { 71. return c >= 0x4E00 && c <= 0x9FFF; 72. } 73. } 74. 75. 76. 77. } 78. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Python.Runtime.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\Semver.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaCore.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuicker.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuickerTools.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaWin32.0.1.54.0.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_zh-Hans_b03f5f7f11d50a3a\System.Net.Http.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 停止动作:编译失败, Compilation, (31,9): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) (31,34): error CS0103: The name 'AutomationElement' does not exist in the current context (38,9): error CS0246: The type or namespace name 'Condition' could not be found (are you missing a using directive or an assembly reference?) (38,35): error CS0246: The type or namespace name 'PropertyCondition' could not be found (are you missing a using directive or an assembly reference?) (38,53): error CS0103: The name 'AutomationElement' does not exist in the current context (39,9): error CS0246: The type or namespace name 'AutomationElementCollection' could not be found (are you missing a using directive or an assembly reference?) (43,18): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Windows.Automation; 14. 15. namespace __ScriptExecution { 16. 17. public class __zpdv9689 18. { 19. 20. 21. // using System; 22. // using System.Collections.Generic; 23. // using System.Windows.Automation; 24. 25. public static class WeChatHelper 26. { 27. public static string Exec(Quicker.Public.IStepContext context) 28. { 29. IntPtr hwnd = new IntPtr(68326); // 微信窗口句柄 30. 31. AutomationElement root = AutomationElement.FromHandle(hwnd); 32. 33. if (root == null) 34. { 35. return "无法获取微信窗口的自动化对象"; 36. } 37. 38. Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text); 39. AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition); 40. 41. List<string> contactNames = new List<string>(); 42. 43. foreach (AutomationElement element in texts) 44. { 45. string name = element.Current.Name.Trim(); 46. if (!string.IsNullOrEmpty(name) && IsValidContactName(name)) 47. { 48. contactNames.Add(name); 49. } 50. } 51. 52. string result = string.Join("\n", contactNames); 53. context.SetVarValue("contactNames", result); // 设置到变量 %contactNames% 54. 55. return $"成功识别 {contactNames.Count} 个好友昵称"; 56. } 57. 58. private static bool IsValidContactName(string text) 59. { 60. if (text.Length < 2 || text.Length > 20) return false; 61. foreach (char c in text) 62. { 63. if (!(char.IsLetterOrDigit(c) || IsChineseChar(c))) 64. return false; 65. } 66. return true; 67. } 68. 69. private static bool IsChineseChar(char c) 70. { 71. return c >= 0x4E00 && c <= 0x9FFF; 72. } 73. } 74. 75. 76. 77. } 78. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Python.Runtime.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\Semver.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaCore.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuicker.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuickerTools.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaWin32.0.1.54.0.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_zh-Hans_b03f5f7f11d50a3a\System.Net.Http.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 耗时:89ms 检测到了中止标志(OperationFailed),停止后续步骤执行。 动作结束。耗时:96.5957ms
07-05
折叠全部 展开全部 Win-10.0.22621.0 Quicker-1.44.13.0 动作ID:29c6dfe2-10d8-4391-9753-a695f715e57a 来源动作: v0 Log文件路径:C:\Users\Administrator\AppData\Local\Temp\quicker_121_100719-246_log.html 定位文件 复制文件 上传并复制网址 开始执行动作:121 2025-07-04 22:07:19 11动作初始化 130运行C#代码 [in]失败后停止【值/表达式】True [in]运行模式【值/表达式】normal_roslyn [in]脚本内容【值/表达式】using System;\r\n using System.Windows.Automation;\r\n using System.Collections.Generic;\r\n \r\n namespace WeChatContactReader\r\n {\r\n public class WeChatHelper\r\n {\r\n // Quicker 调用入口函数\r\n public static string Exec(Quicker.Public.IStepContext context)\r\n {\r\n IntPtr hwnd = new IntPtr(68326); // 硬编码微信窗口句柄,也可通过 context.GetVarValue("hwnd") 获取\r\n \r\n AutomationElement root = AutomationElement.FromHandle(hwnd);\r\n \r\n if (root == null)\r\n {\r\n return "无法获取微信窗口的自动化对象";\r\n }\r\n \r\n Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text);\r\n AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition);\r\n \r\n List<string> contactNames = new List<string>();\r\n \r\n foreach (AutomationElement element in texts)\r\n {\r\n string name = element.Current.Name.Trim();\r\n if (!string.IsNullOrEmpty(name) && IsValidContactName(name))\r\n {\r\n contactNames.Add(name);\r\n }\r\n }\r\n \r\n // 拼接结果并设置到 Quicker 变量中\r\n string result = string.Join("\n", contactNames);\r\n context.SetVarValue("contactNames", result); // 设置到 Quicker 变量 %contactNames%\r\n \r\n return $"成功识别 {contactNames.Count} 个好友昵称";\r\n }\r\n \r\n // 判断是否是有效的联系人名称\r\n private static bool IsValidContactName(string text)\r\n {\r\n if (text.Length < 2 || text.Length > 20) return false;\r\n foreach (char c in text)\r\n {\r\n if (!(char.IsLetterOrDigit(c) || IsChineseChar(c)))\r\n return false;\r\n }\r\n return true;\r\n }\r\n \r\n // 判断字符是否为中文字符\r\n private static bool IsChineseChar(char c)\r\n {\r\n return c >= 0x4E00 && c <= 0x9FFF;\r\n }\r\n }\r\n }\r\n [in]执行线程【值/表达式】ui [in]引用DLL库【值/表达式】 异常:编译失败, Compilation, (18,2): error CS1513: } expected (85,1): error CS1022: Type or namespace definition, or end-of-file expected (34,13): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) (34,38): error CS0103: The name 'AutomationElement' does not exist in the current context (41,13): error CS0246: The type or namespace name 'Condition' could not be found (are you missing a using directive or an assembly reference?) (41,39): error CS0246: The type or namespace name 'PropertyCondition' could not be found (are you missing a using directive or an assembly reference?) (41,57): error CS0103: The name 'AutomationElement' does not exist in the current context (42,13): error CS0246: The type or namespace name 'AutomationElementCollection' could not be found (are you missing a using directive or an assembly reference?) (46,22): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Windows.Automation; 14. 15. namespace __ScriptExecution { 16. 17. public class __2q194u8j 18. { 19. 20. 21. // using System; 22. // using System.Windows.Automation; 23. // using System.Collections.Generic; 24. 25. namespace WeChatContactReader 26. { 27. public class WeChatHelper 28. { 29. // Quicker 调用入口函数 30. public static string Exec(Quicker.Public.IStepContext context) 31. { 32. IntPtr hwnd = new IntPtr(68326); // 硬编码微信窗口句柄,也可通过 context.GetVarValue("hwnd") 获取 33. 34. AutomationElement root = AutomationElement.FromHandle(hwnd); 35. 36. if (root == null) 37. { 38. return "无法获取微信窗口的自动化对象"; 39. } 40. 41. Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text); 42. AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition); 43. 44. List<string> contactNames = new List<string>(); 45. 46. foreach (AutomationElement element in texts) 47. { 48. string name = element.Current.Name.Trim(); 49. if (!string.IsNullOrEmpty(name) && IsValidContactName(name)) 50. { 51. contactNames.Add(name); 52. } 53. } 54. 55. // 拼接结果并设置到 Quicker 变量中 56. string result = string.Join("\n", contactNames); 57. context.SetVarValue("contactNames", result); // 设置到 Quicker 变量 %contactNames% 58. 59. return $"成功识别 {contactNames.Count} 个好友昵称"; 60. } 61. 62. // 判断是否是有效的联系人名称 63. private static bool IsValidContactName(string text) 64. { 65. if (text.Length < 2 || text.Length > 20) return false; 66. foreach (char c in text) 67. { 68. if (!(char.IsLetterOrDigit(c) || IsChineseChar(c))) 69. return false; 70. } 71. return true; 72. } 73. 74. // 判断字符是否为中文字符 75. private static bool IsChineseChar(char c) 76. { 77. return c >= 0x4E00 && c <= 0x9FFF; 78. } 79. } 80. } 81. 82. 83. 84. } 85. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Python.Runtime.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\Semver.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaCore.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuicker.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuickerTools.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaWin32.0.1.54.0.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_zh-Hans_b03f5f7f11d50a3a\System.Net.Http.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 在 rTc1KTvzg91oKUEE8r7.TjNcIivIvOgHbN6UMi2.EsrWRQiFgnX(String , String , String ) 在 rTc1KTvzg91oKUEE8r7.TjNcIivIvOgHbN6UMi2.dWDWRgENtHN(String , String , ActionExecuteContext ) 在 Quicker.Domain.Actions.X.BuiltinRunners.Other.RunCsScriptStep.r52t34kc9u4(ActionStep , ActionExecuteContext , XAction , String , ThreadType ) 在 Quicker.Domain.Actions.X.BuiltinRunners.Other.RunCsScriptStep.<>c__DisplayClass62_0.s39AhW2xkks() 在 Quicker.Domain.Actions.X.XActionHelper.ExecuteCommonAction(ActionExecuteContext context, ActionStep step, XAction action, Func`1 actionFunc, Action successAction, Action failAction, StepInParamDef stopIfErrorParam, StepOutParamDef isSuccessOutputParam) 步骤(sys:csscript)执行失败,原因:编译失败, Compilation, (18,2): error CS1513: } expected (85,1): error CS1022: Type or namespace definition, or end-of-file expected (34,13): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) (34,38): error CS0103: The name 'AutomationElement' does not exist in the current context (41,13): error CS0246: The type or namespace name 'Condition' could not be found (are you missing a using directive or an assembly reference?) (41,39): error CS0246: The type or namespace name 'PropertyCondition' could not be found (are you missing a using directive or an assembly reference?) (41,57): error CS0103: The name 'AutomationElement' does not exist in the current context (42,13): error CS0246: The type or namespace name 'AutomationElementCollection' could not be found (are you missing a using directive or an assembly reference?) (46,22): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Windows.Automation; 14. 15. namespace __ScriptExecution { 16. 17. public class __2q194u8j 18. { 19. 20. 21. // using System; 22. // using System.Windows.Automation; 23. // using System.Collections.Generic; 24. 25. namespace WeChatContactReader 26. { 27. public class WeChatHelper 28. { 29. // Quicker 调用入口函数 30. public static string Exec(Quicker.Public.IStepContext context) 31. { 32. IntPtr hwnd = new IntPtr(68326); // 硬编码微信窗口句柄,也可通过 context.GetVarValue("hwnd") 获取 33. 34. AutomationElement root = AutomationElement.FromHandle(hwnd); 35. 36. if (root == null) 37. { 38. return "无法获取微信窗口的自动化对象"; 39. } 40. 41. Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text); 42. AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition); 43. 44. List<string> contactNames = new List<string>(); 45. 46. foreach (AutomationElement element in texts) 47. { 48. string name = element.Current.Name.Trim(); 49. if (!string.IsNullOrEmpty(name) && IsValidContactName(name)) 50. { 51. contactNames.Add(name); 52. } 53. } 54. 55. // 拼接结果并设置到 Quicker 变量中 56. string result = string.Join("\n", contactNames); 57. context.SetVarValue("contactNames", result); // 设置到 Quicker 变量 %contactNames% 58. 59. return $"成功识别 {contactNames.Count} 个好友昵称"; 60. } 61. 62. // 判断是否是有效的联系人名称 63. private static bool IsValidContactName(string text) 64. { 65. if (text.Length < 2 || text.Length > 20) return false; 66. foreach (char c in text) 67. { 68. if (!(char.IsLetterOrDigit(c) || IsChineseChar(c))) 69. return false; 70. } 71. return true; 72. } 73. 74. // 判断字符是否为中文字符 75. private static bool IsChineseChar(char c) 76. { 77. return c >= 0x4E00 && c <= 0x9FFF; 78. } 79. } 80. } 81. 82. 83. 84. } 85. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Python.Runtime.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\Semver.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaCore.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuicker.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuickerTools.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaWin32.0.1.54.0.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_zh-Hans_b03f5f7f11d50a3a\System.Net.Http.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 停止动作:编译失败, Compilation, (18,2): error CS1513: } expected (85,1): error CS1022: Type or namespace definition, or end-of-file expected (34,13): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) (34,38): error CS0103: The name 'AutomationElement' does not exist in the current context (41,13): error CS0246: The type or namespace name 'Condition' could not be found (are you missing a using directive or an assembly reference?) (41,39): error CS0246: The type or namespace name 'PropertyCondition' could not be found (are you missing a using directive or an assembly reference?) (41,57): error CS0103: The name 'AutomationElement' does not exist in the current context (42,13): error CS0246: The type or namespace name 'AutomationElementCollection' could not be found (are you missing a using directive or an assembly reference?) (46,22): error CS0246: The type or namespace name 'AutomationElement' could not be found (are you missing a using directive or an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Windows.Automation; 14. 15. namespace __ScriptExecution { 16. 17. public class __2q194u8j 18. { 19. 20. 21. // using System; 22. // using System.Windows.Automation; 23. // using System.Collections.Generic; 24. 25. namespace WeChatContactReader 26. { 27. public class WeChatHelper 28. { 29. // Quicker 调用入口函数 30. public static string Exec(Quicker.Public.IStepContext context) 31. { 32. IntPtr hwnd = new IntPtr(68326); // 硬编码微信窗口句柄,也可通过 context.GetVarValue("hwnd") 获取 33. 34. AutomationElement root = AutomationElement.FromHandle(hwnd); 35. 36. if (root == null) 37. { 38. return "无法获取微信窗口的自动化对象"; 39. } 40. 41. Condition condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text); 42. AutomationElementCollection texts = root.FindAll(TreeScope.Descendants, condition); 43. 44. List<string> contactNames = new List<string>(); 45. 46. foreach (AutomationElement element in texts) 47. { 48. string name = element.Current.Name.Trim(); 49. if (!string.IsNullOrEmpty(name) && IsValidContactName(name)) 50. { 51. contactNames.Add(name); 52. } 53. } 54. 55. // 拼接结果并设置到 Quicker 变量中 56. string result = string.Join("\n", contactNames); 57. context.SetVarValue("contactNames", result); // 设置到 Quicker 变量 %contactNames% 58. 59. return $"成功识别 {contactNames.Count} 个好友昵称"; 60. } 61. 62. // 判断是否是有效的联系人名称 63. private static bool IsValidContactName(string text) 64. { 65. if (text.Length < 2 || text.Length > 20) return false; 66. foreach (char c in text) 67. { 68. if (!(char.IsLetterOrDigit(c) || IsChineseChar(c))) 69. return false; 70. } 71. return true; 72. } 73. 74. // 判断字符是否为中文字符 75. private static bool IsChineseChar(char c) 76. { 77. return c >= 0x4E00 && c <= 0x9FFF; 78. } 79. } 80. } 81. 82. 83. 84. } 85. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Python.Runtime.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\Semver.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaCore.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuicker.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaQuickerTools.0.1.54.0.dll C:\Users\Administrator\Documents\Quicker\_packages\cea.tools\0.1.54\CeaWin32.0.1.54.0.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_zh-Hans_b03f5f7f11d50a3a\System.Net.Http.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 耗时:110ms 检测到了中止标志(OperationFailed),停止后续步骤执行。 动作结束。耗时:124.4951ms
07-05
折叠全部 展开全部 Win-10.0.22621.0 Quicker-1.44.13.0 动作ID:32e3bd82-843d-47b3-bffd-af542bba2932 来源动作: v0 Log文件路径:C:\Users\Administrator\AppData\Local\Temp\quicker_闹钟待完善_071018-143_log.html 定位文件 复制文件 上传并复制网址 开始执行动作:闹钟待完善 2025-06-27 19:10:18 42动作初始化 440运行C#代码 [in]失败后停止【值/表达式】False [in]运行模式【值/表达式】normal_roslyn [in]脚本内容【值/表达式】using System;\r\n using System.Threading;\r\n using System.Windows.Forms;\r\n \r\n public class AlarmScript\r\n {\r\n public static void Main()\r\n {\r\n int hour = 9; // 默认小时\r\n int minute = 0; // 默认分钟\r\n \r\n try\r\n {\r\n // 从 Quicker 变量获取值(注意类型转换)\r\n object varHour = Quicker.Variables["Hour"];\r\n object varMinute = Quicker.Variables["Minute"];\r\n \r\n if (varHour == null || varMinute == null)\r\n throw new Exception("输入为空");\r\n \r\n hour = Convert.ToInt32(varHour);\r\n minute = Convert.ToInt32(varMinute);\r\n }\r\n catch\r\n {\r\n MessageBox.Show("请确保 Hour 和 Minute 是有效的数字", "⏰ 输入错误", MessageBoxButtons.OK, MessageBoxIcon.Error);\r\n return;\r\n }\r\n \r\n // 构造目标时间\r\n DateTime alarmTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0);\r\n \r\n // 如果时间已过,则设为明天\r\n if (alarmTime < DateTime.Now)\r\n {\r\n alarmTime = alarmTime.AddDays(1);\r\n }\r\n \r\n MessageBox.Show($"闹钟已设定,将在 {alarmTime:HH:mm:ss} 提醒", "⏰ 闹钟设定成功", MessageBoxButtons.OK, MessageBoxIcon.Information);\r\n \r\n // 每秒检测一次是否到达时间\r\n while (true)\r\n {\r\n if (DateTime.Now >= alarmTime)\r\n {\r\n // 弹出提醒\r\n MessageBox.Show("⏰ 闹钟响了!你设定的时间到了!", "⏰ 闹钟提醒", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);\r\n Console.Beep(800, 1000); // 系统蜂鸣声\r\n break;\r\n }\r\n \r\n Thread.Sleep(1000); // 每秒检查一次\r\n }\r\n }\r\n }\r\n [in]执行线程【值/表达式】auto 线程类型:Ui [in]引用DLL库【值/表达式】 异常:编译失败, Compilation, (36,30): error CS0234: The type or namespace name 'Variables' does not exist in the namespace 'Quicker' (are you missing an assembly reference?) (37,32): error CS0234: The type or namespace name 'Variables' does not exist in the namespace 'Quicker' (are you missing an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Threading; 14. using System.Windows.Forms; 15. 16. namespace __ScriptExecution { 17. 18. public class __yhorgxs9 19. { 20. 21. 22. // using System; 23. // using System.Threading; 24. // using System.Windows.Forms; 25. 26. public class AlarmScript 27. { 28. public static void Main() 29. { 30. int hour = 9; // 默认小时 31. int minute = 0; // 默认分钟 32. 33. try 34. { 35. // 从 Quicker 变量获取值(注意类型转换) 36. object varHour = Quicker.Variables["Hour"]; 37. object varMinute = Quicker.Variables["Minute"]; 38. 39. if (varHour == null || varMinute == null) 40. throw new Exception("输入为空"); 41. 42. hour = Convert.ToInt32(varHour); 43. minute = Convert.ToInt32(varMinute); 44. } 45. catch 46. { 47. MessageBox.Show("请确保 Hour 和 Minute 是有效的数字", "⏰ 输入错误", MessageBoxButtons.OK, MessageBoxIcon.Error); 48. return; 49. } 50. 51. // 构造目标时间 52. DateTime alarmTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0); 53. 54. // 如果时间已过,则设为明天 55. if (alarmTime < DateTime.Now) 56. { 57. alarmTime = alarmTime.AddDays(1); 58. } 59. 60. MessageBox.Show($"闹钟已设定,将在 {alarmTime:HH:mm:ss} 提醒", "⏰ 闹钟设定成功", MessageBoxButtons.OK, MessageBoxIcon.Information); 61. 62. // 每秒检测一次是否到达时间 63. while (true) 64. { 65. if (DateTime.Now >= alarmTime) 66. { 67. // 弹出提醒 68. MessageBox.Show("⏰ 闹钟响了!你设定的时间到了!", "⏰ 闹钟提醒", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 69. Console.Beep(800, 1000); // 系统蜂鸣声 70. break; 71. } 72. 73. Thread.Sleep(1000); // 每秒检查一次 74. } 75. } 76. } 77. 78. 79. 80. } 81. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Data.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 在 rTc1KTvzg91oKUEE8r7.TjNcIivIvOgHbN6UMi2.EsrWRQiFgnX(String , String , String ) 在 rTc1KTvzg91oKUEE8r7.TjNcIivIvOgHbN6UMi2.dWDWRgENtHN(String , String , ActionExecuteContext ) 在 Quicker.Domain.Actions.X.BuiltinRunners.Other.RunCsScriptStep.r52t34kc9u4(ActionStep , ActionExecuteContext , XAction , String , ThreadType ) 在 Quicker.Domain.Actions.X.BuiltinRunners.Other.RunCsScriptStep.<>c__DisplayClass62_0.s39AhW2xkks() 在 Quicker.Domain.Actions.X.XActionHelper.ExecuteCommonAction(ActionExecuteContext context, ActionStep step, XAction action, Func`1 actionFunc, Action successAction, Action failAction, StepInParamDef stopIfErrorParam, StepOutParamDef isSuccessOutputParam) 步骤(sys:csscript)执行失败,原因:编译失败, Compilation, (36,30): error CS0234: The type or namespace name 'Variables' does not exist in the namespace 'Quicker' (are you missing an assembly reference?) (37,32): error CS0234: The type or namespace name 'Variables' does not exist in the namespace 'Quicker' (are you missing an assembly reference?) 代码: 1. using System; 2. using System.Text; 3. using System.Reflection; 4. using System.IO; 5. using System.Net; 6. using System.Net.Http; 7. using System.Collections; 8. using System.Collections.Generic; 9. using System.Collections.Concurrent; 10. using System.Text.RegularExpressions; 11. using System.Threading.Tasks; 12. using System.Linq; 13. using System.Threading; 14. using System.Windows.Forms; 15. 16. namespace __ScriptExecution { 17. 18. public class __yhorgxs9 19. { 20. 21. 22. // using System; 23. // using System.Threading; 24. // using System.Windows.Forms; 25. 26. public class AlarmScript 27. { 28. public static void Main() 29. { 30. int hour = 9; // 默认小时 31. int minute = 0; // 默认分钟 32. 33. try 34. { 35. // 从 Quicker 变量获取值(注意类型转换) 36. object varHour = Quicker.Variables["Hour"]; 37. object varMinute = Quicker.Variables["Minute"]; 38. 39. if (varHour == null || varMinute == null) 40. throw new Exception("输入为空"); 41. 42. hour = Convert.ToInt32(varHour); 43. minute = Convert.ToInt32(varMinute); 44. } 45. catch 46. { 47. MessageBox.Show("请确保 Hour 和 Minute 是有效的数字", "⏰ 输入错误", MessageBoxButtons.OK, MessageBoxIcon.Error); 48. return; 49. } 50. 51. // 构造目标时间 52. DateTime alarmTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, minute, 0); 53. 54. // 如果时间已过,则设为明天 55. if (alarmTime < DateTime.Now) 56. { 57. alarmTime = alarmTime.AddDays(1); 58. } 59. 60. MessageBox.Show($"闹钟已设定,将在 {alarmTime:HH:mm:ss} 提醒", "⏰ 闹钟设定成功", MessageBoxButtons.OK, MessageBoxIcon.Information); 61. 62. // 每秒检测一次是否到达时间 63. while (true) 64. { 65. if (DateTime.Now >= alarmTime) 66. { 67. // 弹出提醒 68. MessageBox.Show("⏰ 闹钟响了!你设定的时间到了!", "⏰ 闹钟提醒", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 69. Console.Beep(800, 1000); // 系统蜂鸣声 70. break; 71. } 72. 73. Thread.Sleep(1000); // 每秒检查一次 74. } 75. } 76. } 77. 78. 79. 80. } 81. } 当前引用:C:\Program Files\Quicker\CommunityToolkit.Mvvm.dll C:\Program Files\Quicker\CSScriptLibrary.dll C:\Program Files\Quicker\Dapper.StrongName.dll C:\Program Files\Quicker\DotNetProjects.SVGImage.dll C:\Program Files\Quicker\DotNetProjects.Wpf.Extended.Toolkit.dll C:\Program Files\Quicker\FlaUI.Core.dll C:\Program Files\Quicker\FontAwesomeIconsWpf.dll C:\Program Files\Quicker\GongSolutions.WPF.DragDrop.dll C:\Program Files\Quicker\HandyControl.dll C:\Program Files\Quicker\HL.dll C:\Program Files\Quicker\ICSharpCode.AvalonEdit.dll C:\Program Files\Quicker\log4net.dll C:\Program Files\Quicker\MdXaml.dll C:\Program Files\Quicker\Microsoft.Bcl.AsyncInterfaces.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.CSharp.dll C:\Program Files\Quicker\Microsoft.CodeAnalysis.dll C:\Program Files\Quicker\Microsoft.Web.WebView2.Core.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.dll C:\Program Files\Quicker\Microsoft.WindowsAPICodePack.Shell.dll C:\Program Files\Quicker\NamedPipeWrapper.dll C:\Program Files\Quicker\NAudio.dll C:\Program Files\Quicker\Newtonsoft.Json.dll C:\Program Files\Quicker\Ninject.dll C:\Program Files\Quicker\NPOI.dll C:\Program Files\Quicker\PInvoke.User32.dll C:\Program Files\Quicker\PInvoke.Windows.Core.dll C:\Program Files\Quicker\Quicker.3rd.dll C:\Program Files\Quicker\Quicker.Common.dll C:\Program Files\Quicker\Quicker.exe C:\Program Files\Quicker\Quicker.Public.dll C:\Program Files\Quicker\System.Buffers.dll C:\Program Files\Quicker\System.Collections.Immutable.dll C:\Program Files\Quicker\System.Data.SQLite.dll C:\Program Files\Quicker\System.Memory.dll C:\Program Files\Quicker\System.Net.Http.Formatting.dll C:\Program Files\Quicker\System.Numerics.Vectors.dll C:\Program Files\Quicker\System.Reflection.Metadata.dll C:\Program Files\Quicker\System.Runtime.CompilerServices.Unsafe.dll C:\Program Files\Quicker\System.Threading.Tasks.Extensions.dll C:\Program Files\Quicker\ToastNotifications.dll C:\Program Files\Quicker\ToastNotifications.Messages.dll C:\Program Files\Quicker\WindowsInput.dll C:\Program Files\Quicker\Z.Expressions.Eval.dll C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\mscorlib.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationCore.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationCore.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\PresentationFramework.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemData.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Globalization\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Globalization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.RuntimeInformation.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51\System.ValueTuple.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Controls.Ribbon\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Controls.Ribbon.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes.resources\v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35\UIAutomationTypes.resources.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Core.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll C:\Windows\system32\WinMetadata\Windows.ApplicationModel.winmd C:\Windows\system32\WinMetadata\Windows.Data.winmd C:\Windows\system32\WinMetadata\Windows.Devices.winmd C:\Windows\system32\WinMetadata\Windows.Foundation.winmd C:\Windows\system32\WinMetadata\Windows.Graphics.winmd C:\Windows\system32\WinMetadata\Windows.Management.winmd C:\Windows\system32\WinMetadata\Windows.Media.winmd C:\Windows\system32\WinMetadata\Windows.Storage.winmd C:\Windows\system32\WinMetadata\Windows.UI.winmd 耗时:106ms 动作结束。耗时:171.3188ms
06-28
`System.Security.Cryptography.CngKey` 是 .NET Framework 和 .NET Core 中用于与 Windows 的 CNG(Cryptography API: Next Generation)进行交互的重要类,主要用于管理非对称密钥。该类提供了创建、打开和操作 CNG 密钥的功能,并支持多种加密算法,例如 RSA、ECC 和 DSA 等。 ### 创建 CNG 密钥 可以使用 `CngKey.Create` 方法生成一个新的密钥,示例代码如下: ```csharp using System; using System.Security.Cryptography; class Program { static void Main() { // 创建一个RSA类型的CNG密钥 CngKey key = CngKey.Create(CngAlgorithm.RsaSign); // 输出密钥的句柄 Console.WriteLine("密钥已创建,句柄:" + key.Handle); // 释放资源 key.Dispose(); } } ``` 上述代码创建了一个用于签名的 RSA 类型密钥[^1]。 ### 打开现有的 CNG 密钥 如果需要访问已经存在的密钥,可以使用 `CngKey.Open` 方法,通过指定密钥名称和提供程序来打开它: ```csharp using System; using System.Security.Cryptography; class Program { static void Main() { // 打开现有密钥 CngKey key = CngKey.Open("MyExistingKey", CngProvider.MicrosoftSoftwareKeyStorageProvider); // 检查是否成功打开密钥 if (key != null) { Console.WriteLine("密钥已打开,算法:" + key.Algorithm); key.Dispose(); } else { Console.WriteLine("无法到指定的密钥。"); } } } ``` 在上述代码中,密钥名称为 `"MyExistingKey"`,并指定了 Microsoft 软件密钥存储提供程序[^2]。 ### 获取密钥属性 可以通过 `GetProperty` 方法获取密钥的特定属性,例如密钥大小: ```csharp using System; using System.Security.Cryptography; class Program { static void Main() { CngKey key = CngKey.Create(CngAlgorithm.RsaSign); // 获取密钥大小 byte[] keySizeBytes = key.GetProperty("KeyLength", CngPropertyOptions.None); int keySize = BitConverter.ToInt32(keySizeBytes, 0); Console.WriteLine("密钥大小:" + keySize + " bits"); key.Dispose(); } } ``` ### 删除 CNG 密钥 当不再需要某个密钥时,可以调用 `Delete` 方法将其从系统中删除: ```csharp using System; using System.Security.Cryptography; class Program { static void Main() { // 创建一个临时密钥 CngKey tempKey = CngKey.Create(CngAlgorithm.RsaSign); // 删除密钥 tempKey.Delete(); Console.WriteLine("密钥已删除。"); } } ``` 需要注意的是,在调用 `Delete` 方法之前,应确保密钥不再被使用,并且已经调用了 `Dispose` 方法以正确释放资源。 ### 使用 CNG 密钥进行签名和验证 `System.Security.Cryptography.CngKey` 可以用于数字签名和验证操作,以下是一个简单的示例,演示如何使用 CNG 密钥进行 RSA 签名和验证: ```csharp using System; using System.Security.Cryptography; using System.Text; class Program { static void Main() { // 创建RSA签名密钥 CngKey key = CngKey.Create(CngAlgorithm.RsaSign); // 初始化RSA签名服务提供程序 using (RSACng rsa = new RSACng(key)) { string data = "Hello, World!"; byte[] dataBytes = Encoding.UTF8.GetBytes(data); // 计算哈希值并进行签名 byte[] signature = rsa.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); // 验证签名 bool isValid = rsa.VerifyData(dataBytes, signature, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); Console.WriteLine("签名验证结果:" + (isValid ? "有效" : "无效")); } key.Dispose(); } } ``` 以上代码展示了如何使用 `RSACng` 类结合 `CngKey` 实现签名和验证功能[^3]。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值