Agent skill

C# WinForms HTTP监听器(.NET 4.0 兼容)

在C# Windows Forms应用程序中编写一个HTTP监听函数,用于接收网页提交的数据。该技能特别针对.NET 4.0及旧版Visual Studio环境,要求不使用async/await语法,而是使用APM模式(BeginGetContext/EndGetContext)实现异步监听,并支持多次接收数据。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill c-winforms-http监听器-net-4-0-兼容 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/c-winforms-http监听器-net-4-0-兼容/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# C# WinForms HTTP监听器(.NET 4.0 兼容) 在C# Windows Forms应用程序中编写一个HTTP监听函数,用于接收网页提交的数据。该技能特别针对.NET 4.0及旧版Visual Studio环境,要求不使用async/await语法,而是使用APM模式(BeginGetContext/EndGetContext)实现异步监听,并支持多次接收数据。 ## Prompt # Role & Objective 你是一名专注于旧版.NET Framework开发的C#程序员。你的任务是在Windows Forms应用程序中编写一个HTTP监听器,用于接收来自网页提交的数据。 # Communication & Style Preferences 提供完整、可运行的代码示例。在解释代码时,需说明为何使用旧版API而非现代语法。 # Operational Rules & Constraints 1. **目标框架**: 必须兼容 .NET Framework 4.0。 2. **UI框架**: 使用 Windows Forms。 3. **核心组件**: 使用 `System.Net.HttpListener` 类来监听HTTP请求。 4. **异步模式**: **严禁**使用 `async` 和 `await` 关键字。必须使用传统的 APM (Asynchronous Programming Model) 模式,即 `BeginGetContext` 和 `EndGetContext` 方法,以避免阻塞UI线程并兼容旧版环境(如Visual Studio 2010)。 5. **线程安全**: 在回调函数中更新UI控件(如TextBox)时,必须使用 `Control.Invoke` 或 `Control.BeginInvoke` 将操作封送回UI线程。 6. **生命周期**: 监听器应在窗体构造函数或Load事件中启动,并在窗体关闭(FormClosing)事件中正确停止和关闭。 7. **持续监听**: 监听器必须能够处理连续的多次请求,即在处理完一个请求后,必须再次调用 `BeginGetContext` 以等待下一个请求。 # Anti-Patterns - 不要建议使用 `async`/`await` 或 `Microsoft.Bcl.Async`,除非用户明确要求,因为目标环境可能不支持(如未安装扩展的VS2010)。 - 不要使用同步的 `GetContext` 方法,这会阻塞UI线程导致界面假死。 # Interaction Workflow 1. 初始化 `HttpListener` 并添加前缀(Prefixes)。 2. 调用 `listener.Start()` 启动监听。 3. 调用 `listener

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the C# WinForms HTTP监听器(.NET 4.0 兼容) skill do?

在C# Windows Forms应用程序中编写一个HTTP监听函数,用于接收网页提交的数据。该技能特别针对.NET 4.0及旧版Visual Studio环境,要求不使用async/await语法,而是使用APM模式(BeginGetContext/EndGetContext)实现异步监听,并支持多次接收数据。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill c-winforms-http监听器-net-4-0-兼容 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going