-1

我正在编写一个应该加载网站的应用程序。加载网站后,我必须向网页启动第二个命令,这是一种 Javascript 脚本。

我在浏览器中手动执行此操作,通常它似乎工作正常。他们手动操作的方式是我在浏览器中创建了两个快捷方式:

  1. 本网站的 URL(例如http://www.example.net/123456-e.aspx
  2. 调用本网站上的函数的 Scriptlet 的快捷方式(例如javascript:__doPostBack('Video_Info1$Rating_control1$lnk_star5','')).

我首先单击 URL 快捷方式,然后在加载后启动第二个快捷方式。

但是如何在 C# 应用程序中做到这一点?


但是,我想做的事情与我想的完全相反。

我想发送_postBack到现有网站。我不是在编写我自己的包含 postBack 控件的网站!

让我稍微详细解释一下...

我在我的应用程序中加载的网站是网络中现有的 ASPX 网站。在此站点中,您会找到几个_doPostback条目,并且在浏览器中,postBack 事件(当我在书签/快捷方式中手动点击它时)将被发回并具有所需的结果(在这种情况下,它分配“5 星”告诉大家,有些东西非常好;-)。

所以,我想做的是编写我的 C# 应用程序,它会在_postBack我每次点击 OK 按钮或其他一些事件时发送这个命令。就像我上面的链接一样

"javascript:__doPostBack('Video_Info1$Rating_control1$lnk_star5','')"

这是我在浏览器书签面板上的书签 - 一个快捷方式!

.... 老实说,这是一种作弊,它将在外部站点上进行自动投票...

我现在的问题是,...我怎样才能将它_postBack直接发送到网站,以增加我的星星?

4

1 回答 1

0

I am not sure what exactly you are trying to achieve, The code which you are seeing (_doPastBack(..)) is actually going to invoke a server method (code in your codebehind of that page).

You can create a webpage and have an iframe and load your first page in that.The user will be able to click on any of the button and invoke the corresponding server code if there is one attached.

<html>
<body>
  <iframe src="http://www.example.net/123456-e.aspx"></iframe>
</body>
于 2012-04-08T18:33:21.270 回答