在不修改 OpenClaw 源码的前提下,从脚本内部感知当前所属 session 的多种方法。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Window x:Class="SystemDrag.DragDropHintWindow" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| Title="DragDropHintWindow" | |
| Height="60" Width="250" | |
| AllowsTransparency="True" | |
| WindowStyle="None" | |
| Topmost="True" | |
| Background="#CC000000" | |
| Foreground="White" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // zipFiles 将指定目录下的文件和文件夹打包成一个ZIP归档文件。 | |
| // | |
| // 参数: | |
| // dir string - 必须是一个绝对路径的文件夹路径。 | |
| // files []string - 只能包含dir目录下的文件夹名称或文件名称。 | |
| // | |
| // 返回值: | |
| // string - 生成的ZIP文件的名称。 | |
| // error - 如果过程中发生错误,返回相应的错误信息。 | |
| func zipFiles(dir string, files []string) (string, error) { |