问题描述
所以我有这个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" />
推荐答案
这篇关于批量脚本允许自动单击链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!