技术代码:ASP & ASP.NET

1E:\www\site_root\images>del E:\www\site_root\images\lpt1.asp
2文件名、目录名或卷标语法不正确。
3
4E:\www\site_root\images>attrib \\.\E:\www\site_root\images\lpt1.asp
5A  SHR     \\.\E:\www\site_root\images\lpt1.asp
6
7E:\www\site_root\images>del E:\www\site_root\images\lpt1*
8找不到 E:\www\site_root\images\lpt1*
9
10E:\www\site_root\images>del E:\www\site_root\images\lp*
11
12E:\www\site_root\images>attrib \\.\E:\www\site_root\images\lpt1.asp
13A  SHR     \\.\E:\www\site_root\images\lpt1.asp
14
15E:\www\site_root\images>attrib \\.\E:\www\site_root\images\lpt1.asp
16A  SHR     \\.\E:\www\site_root\images\lpt1.asp
17
18E:\www\site_root\images>attrib -H \\.\E:\www\site_root\images\lpt1.asp
19未重设系统文件 - \\.\E:\www\site_root\images\lpt1.asp
20
21E:\www\site_root\images>attrib -S -R -H \\.\E:\www\site_root\images\lpt1.asp
22
23E:\www\site_root\images>attrib -H \\.\E:\www\site_root\images\lpt1.asp
24
25E:\www\site_root\images>attrib \\.\E:\www\site_root\images\lpt1.asp
26A          \\.\E:\www\site_root\images\lpt1.asp
27
28
29E:\www\site_root\images>attrib \\.\E:\www\site_root\images\lpt1.asp
30A          \\.\E:\www\site_root\images\lpt1.asp
31
32E:\www\site_root\images>copy \\.\E:\www\site_root\images\lpt1.asp f:\aa.txt
33已复制         1 个文件。
34
35E:\www\site_root\images>del \\.\E:\www\site_root\images\lpt1.asp
参考地址:删除windows上lpt1.asp伪装木马文件(SHR属性),及一次查杀web木马简记
1public override void Process(TagHelperContext context, TagHelperOutput output)
2    {
3      if (string.IsNullOrEmpty(Claim))
4      {
5        return;
6      }
7      string[] claimData = Claim.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
8      if (claimData.Length == 1)
9      {
10        if (!ViewContext.HttpContext.User.HasClaim(m => m.Type == claimData[0]))
11        {
12          //无权限
13          output.SuppressOutput();
14        }
15      }
16      else
17      {
18        if (!ViewContext.HttpContext.User.HasClaim(m => m.Type == claimData[0] && m.Value == claimData[1]))
19        {
20          //无权限
21          output.SuppressOutput();
22        }
23      }
24}
参考地址:asp.net core mvc权限控制:在视图中控制操作权限
1{
2  "name": "ASP.NET",
3  "private": true,
4  "dependencies": {
5    "bootstrap": "3.0.0",
6    "bootstrap-touch-carousel": "0.8.0",
7    "hammer.js": "2.0.4",
8    "jquery": "2.1.4",
9    "jquery-validation": "1.11.1",
10    "jquery-validation-unobtrusive": "3.2.2"
11  }
12}
参考地址:asp.net 5 新特性简述(学习笔记)
1Function file_get_contents(filename)   
2Dim fso, f   
3Set fso = Server.CreateObject("Scripting.FilesystemObject")   
4Set f = fso.OpenTextFile(Server.MapPath(filename), 1)   
5file_get_contents = f.ReadAll   
6f.Close   
7Set f = Nothing   
8Set fso = Nothing   
9End Function   
10Function class_get_contents(filename)   
11Dim contents   
12contents = file_get_contents(filename)   
13contents = Replace(contents, "<" & "%", "")   
14contents = Replace(contents, "%" & ">", "")   
15class_get_contents = contents   
16End Function
参考地址:ASP中Server.Execute和Execute实现动态包含(include)脚本的区别
1@model PartyInvites.Models.GuestResponse
2@{
3Layout = null;
4}
5<!DOCTYPE html>
6<html>
7<head>
8<meta name="viewport" content="width=device-width" />
9<title>RsvpForm</title>
10</head>
11<body>
12
13<form asp-action="RsvpForm" method="post">
14<p>
15<label asp-for="Name">Your name:</label>
16<input asp-for="Name" />
17</p>
18<p>
19<label asp-for="Email">Your email:</label>
20<input asp-for="Email" />
21</p>
22<p>
23<label asp-for="Phone">Your phone:</label>
24<input asp-for="Phone" /></p>
25<p>
26<label>Will you attend?</label>
27<select asp-for="WillAttend">
28<option value="">Choose an option</option>
29<option value="true">Yes, I'll be there</option>
30<option value="false">No, I can't come</option>
31</select>
32</p>
33<button type="submit">Submit RSVP</button>
34</form>
35</body>
36</html>
参考地址:读书笔记:Pro ASP.NET Core MVC 2 [Chap2 ]
1app.UseMvc(routes =>
2{
3    routes.MapRoute(
4        name: "default",
5        template: "{controller:slugify=Home}/{action:slugify=Index}/{id?}");
6
7    routes.MapRoute(
8       name: "areas",
9       template: "{area:exists:slugify}/{controller:slugify=Home}/{action:slugify=Index}/{id?}"
10    );
11});
12复制代码
参考地址:构建可读性更高的 ASP.NET Core 路由
1body{
2  color: #696969;
3}
4a:link {
5  color: #3b3420;
6  text-decoration: none;
7}
8
9a:visited {
10  color: #3b3420;
11  text-decoration: none;
12}
13
14a:hover {
15  color: #a52f09;
16  text-decoration: none;
17}
18
19a:active {
20  color: #a52f09;
21}
22
23a.order-button, a.order-button:hover{
24  color: #fdfcf7;
25}
26
27.productInfo, .action{
28  max-width: 200px;
29}
30
31p{
32  font-size: 0.8rem;
33}
34
35#orderProcess {
36  list-style: none;
37  padding: 0;
38  clear: both;
39}
40
41#orderProcess li {
42  color: #696969;
43  display: inline;
44  font-size: 1.2em;
45  margin-right: 15px;
46  padding: 3px 0px 0px 5px;
47}
48
49.step-number {
50    background-color: #edece8;
51    border: 1px solid #e6e4d9;
52    font-size: 1.5em;
53    margin-right: 5px;
54    padding: 3px 10px;
55}
56
57.current .step-number {
58    background-color: #a52f09;
59    border-color: #712107;
60    color: #fefefe;
61} 
62
63.orderPageList{
64    padding-inline-start: 20px;
65}
66
67.actions .order-button{
68  margin-left:20px;
69}
参考地址:ASP.NET Core Razor Pages 教程五 使用数据
1<form method="post">
2    <div class="row">
3        <div class="col-3">
4            <img src="~/Images/Products/Thumbnails/@Model.Product.ImageName" class="img-fluid img-thumbnail" alt="Image of @Model.Product.Name"/>
5        </div>
6        <div class="col-9">
7            <ul class="orderPageList" data-role="listview">
8                <li>
9                    <div>
10                        <p class="description">@Model.Product.Description</p>
11                    </div>                
12                </li>
13                <li class="email">
14                    <div class="form-group">
15                        <label asp-for="OrderEmail"></label>
16                        <input asp-for="OrderEmail" class="form-control form-control-sm" />                
17                        <span asp-validation-for="OrderEmail"></span>
18                    </div>
19                </li>
20                <li class="shipping">
21                    <div class="form-group">
22                        <label asp-for="OrderShipping"></label>
23                        <textarea rows="4" asp-for="OrderShipping" class="form-control form-control-sm"></textarea>               
24                        <span asp-validation-for="OrderShipping"></span>
25                    </div>
26                </li>
27                <li class="quantity">
28                    <div class="form-group row">
29                        <label asp-for="OrderQuantity" class="col-1 col-form-label"></label>
30                        <input asp-for="OrderQuantity" class="form-control form-control-sm"/>
31                        x
32                        <span class="order-calc" id="orderPrice">@Model.Product.Price.ToString("f")</span>
33                        =
34                        <span class="order-calc" id="orderTotal">@Model.Product.Price.ToString("f")</span>
35                        <span asp-validation-for="OrderQuantity"></span>
36                    </div>
37                </li>
38            </ul>
39            <p class="actions">
40                <input type="hidden" asp-for="Product.Id" />
41                <button class="btn btn-danger order-button">Place Order</button>
42            </p>
43        </div>
44    </div>
45</form>
46
47
48@section scripts{
49<script type="text/javascript">
50    $(function () {
51        var price = parseFloat($("#orderPrice").text()).toFixed(2),
52            total = $("#orderTotal"),
53            orderQty = $("#OrderQuantity");
54
55        orderQty.on(‘change‘, function () {
56            var quantity = parseInt(orderQty.val());
57            if (!quantity || quantity < 1) {
58                orderQty.val(1);
59                quantity = 1;
60            } else if (quantity.toString() !== orderQty.val()) {
61                orderQty.val(quantity);
62            }
63            total.text("$" + (price * quantity).toFixed(2));
64        });
65    });
66</script>
67}
参考地址:ASP.NET Core Razor Pages 教程六 处理表单
1<asp:ToolkitScriptManager runat="Server" />
2<asp:TextBox
3        ID="txtComments"
4        TextMode="MultiLine"
5        Columns="60"
6        Rows="8"
7        runat="server" />
8 
9<asp:HtmlEditorExtender
10        TargetControlID="txtComments"
11        runat="server" />
参考地址:Asp.net_Ajax Control Toolkit的使用初步
1<form id="form1" method="post" enctype="multipart/form-data" asp-controller="HardDisks" asp-action="ImportExcel">
2                                <div class="fileupload btn btn-purple waves-effect waves-light">
3                                    <span><i class="ion-upload m-r-5"></i>Choose File...</span>
4                                    <input class="upload" type="file" id="files" name="files" multiple />
5                                </div>
6
7                                <button class="btn btn-default waves-effect m-b-5" type="button" οnclick="funSubmit()" style="margin-top:5px;">Submit</button>
8                                <i class="md md-get-app" style="cursor:pointer" οnclick="downdloadTemplate()"></i> 
9                            </form>
10
11function funSubmit() {
12            $("#form1").ajaxSubmit({
13                success: function (data) {
14                    alert(data);
15                }
16            });
17        }
参考地址:asp.net core mvc ajaxform submit files

代码交流 2021