添加新帖子到Facebook VB 2008 [英] add new post to facebook vb 2008

查看:102
本文介绍了添加新帖子到Facebook VB 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,我正在尝试向Facebook添加新帖子,查看代码

  Private Sub WebBrowser1_DocumentCompleted(ByVal发送者为System.Object,ByVal e为System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)处理WebBrowser1.DocumentCompleted
       WebBrowser1.Document.GetElementById("xhpc_message").Focus()
       WebBrowser1.Document.GetElementById("xhpc_message").SetAttribute("value","https://www.facebook.com/Neeosearch")
   结束

它可以正常工作,但是在调用"https://www.facebook.com/Neeosearch"时再次WebBrowser1_DocumentCompleted已清除.

调用此WebBrowser1_DocumentCompleted函数的次数几乎是8-9倍,因此我无法解决此问题.当加载单个页面的facebook时,将一次又一次调用WebBrowser1_DocumentCompleted函数,因此此功能清除了数据 我张贴的.

请帮助我如何在Facebook页面上添加新帖子.


Neeo

解决方案

实际上,您可以定义一个名为flag的全局变量,将其初始化为false,这意味着第一次加载. /p>

加载成功后,将其设置为true:

私有子WebBrowser1_DocumentCompleted(ByVal发送者为System.Object,ByVal e为System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
 处理WebBrowser1.DocumentCompleted

          如果(不标记)则

         WebBrowser1.Document.GetElementById("xhpc_message").Focus()
         WebBrowser1.Document.GetElementById("xhpc_message").SetAttribute("value","https://www.facebook.com/Neeosearch")

flag = true
如果结束 结束Sub


hello sir i am trying to add a new post to facebook, look code

 Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        WebBrowser1.Document.GetElementById("xhpc_message").Focus()
        WebBrowser1.Document.GetElementById("xhpc_message").SetAttribute("value", "https://www.facebook.com/Neeosearch")
    End Sub

its work fine, but it again WebBrowser1_DocumentCompleted when called then "https://www.facebook.com/Neeosearch" is cleared.

i counted almost 8-9 times this WebBrowser1_DocumentCompleted function is called, so i am unable to solve this matter. when a single page of facebook is loaded, WebBrowser1_DocumentCompleted function is called again and again, so this fuction cleared data which i posted.

please help me how i can add a new post to facebook page.


Neeo

解决方案

In fact you can define a global variable called flag, initialize it false, this means the first loading.

When loading successfully, set it as true:

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
 Handles WebBrowser1.DocumentCompleted

          If(Not flag) Then
            
         WebBrowser1.Document.GetElementById("xhpc_message").Focus()
         WebBrowser1.Document.GetElementById("xhpc_message").SetAttribute("value", "https://www.facebook.com/Neeosearch")

flag=true
End If End Sub


这篇关于添加新帖子到Facebook VB 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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