Win11系统提示找不到Windows.UI.Xaml.Resources.Common.dll文件的解决办法

在大部分情况下出现我们运行或安装软件,游戏出现提示丢失某些DLL文件或OCX文件的原因可能是原始安装包文件不完整造成,原因可能是某些系统防护软件将重要的DLL文件识别为可疑,阻止并放入了隔离单里,还有一些常见的DLL文件缺少是因为系统没有安装齐全的微软运行库,还有部分情况是因为系统更新升级补丁造成的系统内部文件损坏。 其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个Windows.UI.Xaml.Resources.Common.dll文件(挑选合适的版本文件)把它放入到程序或系统目录中,当我们执行某一个.exe程序时,相应的DLL文件就会被调用,因此将缺失的文件放回到原目录之后就能打开你的软件或游戏了.

那么出现Windows.UI.Xaml.Resources.Common.dll丢失要怎么解决?

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

1、从下面列表下载Windows.UI.Xaml.Resources.Common.dll文件
32/64位 文件:
Windows.UI.Xaml.Resources.Common.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)即可打开软件,
 

1,选择软件界面左侧的“文件下载”菜单。如下图所示


 

2,在右侧的文本输入框中输入您想要下载的文件完整名称后点击下载按钮。


 

3,下载完成后,查看文件版本号和文件类型(32或64位),挑选所需的版本类型的文件,点击右侧的“打开”按钮。


 

注:如果点击下载按钮下载完成后没有文件显示,可以右键桌面上的DLLEscort图标,选择“打开文件所在的位置”进入“FileRepair”文件夹接下来可以看到要下载的文件名的目录。

三、DLLEscort软件一键安装Windows运行库使用方法(高级用户)

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


 


 

二、扫描完成,扫描结果分成三部分,包括1,待修复的丢失文件。 2,待修复的注册表。 3.待清理的系统缓存文件。 在扫描完成后我们要勾选底部的“修复运行库”


 

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

四、如果系统安装了"360安全卫士" 或一些其它安全类软件在修复过程中可能会出现拦截,请手动选择"允许程序所有操作"

折叠全部 展开全部 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值