更改存根代码后面的初始 Visual Studio 代码?

发布于 2024-08-09 01:07:04 字数 183 浏览 2 评论 0原文

当我向 ASP.NET 项目 (WebForms) 添加新表单,然后“查看代码”时,会添加一些基本的存根代码 - 基本的“using”语句、form_load 事件等。

所以我要做的第一件事是添加一些项目使用等。有没有办法将这个固定代码更改为我想要的,而不是默认设置的?

模板会是答案吗?

TIA 凯文

When I add a new form to an ASP.NET project (WebForms), and then "View Code" some basic stub code is added -- basic "using" statements, form_load event, etc.

So the first thing I have to do is add some project usings, etc. Is there anyway to alter this canned code to what I want, vs. what it puts up by default?

Would templates be the answer?

TIA
Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甩你一脸翔 2024-08-16 01:07:04

是的你是对的。那是一个模板。

您可以将项目模板归档到以下目录

%VisualStudioPath%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\CSharp\Web\1033

和项目模板

%VisualStudioPath%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web \1033

Yes, you are right. that is a template.

You can file project templates in the following directory

%VisualStudioPath%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\CSharp\Web\1033

And item templates

%VisualStudioPath%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033

Bonjour°[大白 2024-08-16 01:07:04

我认为如果我正确理解您的问题,Visual Studio 的 Templates 将会帮助您解决您的问题。

Visual Studio 中有两种不同的模板类型:

  1. Item Template
  2. Project Template

您可以在此处找到有关 Visual Studio 模板的更多信息:Visual Studio 中的模板

I think Templates is Visual Studio would help you in your problem if I understood your problem correctly.

There are two different template types in Visual Studio :

  1. Item Template
  2. Project Template

You can find more information about Visual Studio Templates here : Templates in Visual Studio

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文