1. 新建一个Class library project,添加对System.Web的引用
2. 项目添加一个user control
3. 编写这个Web Part
4. 为程序集添加强名称
5. 更改build的输出目录,改为C:\Inetpub\wwwroot\wss\VirtualDirectories\[Site的端口号]\_app_bin\
6. 修改AssemblyInfo.cs,添加using System.Security;和 [assembly: AllowPartiallyTrustedCallers()]
7. 更改user control的属性,将Copy to output directory改为copy if newer
8. Build工程
9. 用Reflector打开刚刚生成的dll,找到Assembly的信息
10. 打开C:\Inetpub\wwwroot\wss\VirtualDirectories\[Site 端口号]\web.config文件,在SafeControls下添加一行
<SafeControl Assembly="BR.WebParts.UControlDemo1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1e038d98fe593539" Namespace="BR.WebParts.UControlDemo1" TypeName="UserControlPart" Safe="True"/>
其中Assembly的信息是从Reflector里面取到的
10.最后把这个Web Part添加到网页上就可以了
KaneBoy的一篇文章提到使用Feature的部署DelegateContorl的方式部署一个ascx文件到站点集的Feature
0
0
[C#]创建Windows用户及组
[C#]读取指定路径的配置文件[转]
[C#]安装WindowsService的关键步骤
[C#]如何解决修改注册表受限问题(转)
[C#]DES再一例(转)
[C#]获取当前程序运行路径的方法集合(转)
[Postgres]Postgres复制表
[Postgres]postgresql.conf : Permission denied处理一法
【转】/proc/sysrq-trigger 详解
- 最新文章
-
关于springboot 连接mysql 数据库报错问题
关于 spring-aop理解
mysql 函数以及操作总结
关于解决idea 输入法不跟随问题
关于实现mybatis order by 排序传递参数实现 问题记录
linux 操作之一 如何在linux将本地数据*.sql文件导入到linux 云服务器上的mysql数据库
spring boot 入门3 如何在springboot 上使用AOP
CVE-2019-7238 poc
Dell KACE K1000 poc
泛微 e-cology OA 前台SQL注入
- 热门文章
-
Linux passwd 提权
Misdirection: 1靶机writeup
Linux suid 提权
DC-8靶机writeup
parrot os安装vmware pro
Unable to start services. See log file /tmp/vmware-root/vmware-6853.log for details.
Jenkins漏洞利用复现
JS代码静态分析及挖掘
泛微 e-cology远程代码执行漏洞
[CentOS]CentOS下编译CPP文件时报错[undefined reference to `__gxx_personality_v0' collect2: ld]的解决办法