批量脚本允许自动单击链接按钮 [英] Batch scripting to allow automatic click of link buttons

查看:95
本文介绍了批量脚本允许自动单击链接按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有这个localhost网站,显示可以下载的图像的gridview(使用链接按钮)。我创建了一个批处理文件,并编写了一些脚本以在Windows任务计划程序中导入它。它工作正常。但现在,我正在尝试让脚本点击。目前,它只是运行/打开localhost网站。



我尝试过:



这是我的代码:

@ECHO OFF

SET BROWSER = chrome.exe

START%BROWSER% - new-tab http:// localhost:7665 / AdvGridView.aspx

@ping 127.0.0.1 -n%WAIT_TIME%-w 1000> nul

暂停







aspx:

So I have this localhost website that shows gridview of images that can be downloaded (link button used). I created a batch file and wrote some script to import it in Windows Task Scheduler. It works fine. But now, i'm trying to make the script do the clicking. Currently, it just runs/ open the localhost website.

What I have tried:

Here's my code:
@ECHO OFF
SET BROWSER=chrome.exe
START %BROWSER% - new-tab "http://localhost:7665/AdvGridView.aspx"
@ping 127.0.0.1 -n %WAIT_TIME% -w 1000 > nul
Pause



aspx:

<form id="form1" runat="server">
    <div>
         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnRowCommand="GridView1_RowCommand">
                    <Columns>
                        <asp:BoundField HeaderText="ID" DataField="AdvID" />
                        <asp:BoundField HeaderText="Name" DataField="Name" />
                        <asp:BoundField HeaderText="Item" DataField="Item" />
                        <asp:ImageField HeaderText="Image" DataImageUrlField="ImgPath" ControlStyle-Height="120" ControlStyle-Width="140">
                            <ControlStyle Height="120px" Width="140px"></ControlStyle>
                        </asp:ImageField>
                        <asp:TemplateField HeaderText="View Information">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkView" runat="server" CommandArgument='<%#Eval("AdvID") %>' OnClick="lnk_OnClick">View</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="DownloadLink">
                            <ItemTemplate>
                       <asp:Button ID="lnkDownload" runat="server" Text="Download" OnClick="DownloadFile"
                                        CommandArgument='<%# Eval("AdvID") %>' ></asp:Button>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
        <asp:Button ID="btnDownload" runat="server" Text="Download" OnClick="lnk_OnClick" />

推荐答案

您将不得不编写一个应用程序来加载网站并执行点击。没有什么可以放入批量文件中点击链接。
You're going to have to write an application to load the web site and do the "clicking". There's nothing you can put into a batch file that will click a link.


这篇关于批量脚本允许自动单击链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆