怎么通过webbrowser向网页中的文本框输入字符串

如何通过webbrowser向网页中的文本框输入字符串?
其实我想编一个邮箱自动注册程序,可是在第一步使用webbrowser向网页中的文本框输入字符串就失败了,请帮忙解答一下
我的代码如下
Dim ii As Integer
   
  Private Sub Form_Load()
  WebBrowser1.Navigate "http://login.sina.com.cn/signup/signup1.php"
  End Sub
   
  Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  Dim doc As IHTMLDocument2
  Set doc = WebBrowser1.Document
  Dim tmp As String
   
  If InStr(doc.body.innerText, "邮箱名称:") > 0 Then
  tmp = "sdfsdf23"
  doc.All.Item("username").focus
  SendKeys tmp

  End If
   

   
  End Sub

运行后,网页提示我输入邮箱名,可我应该已经通过sendkeys添加了啊。我这个哪里不正确呢,
顺便问一句,我如何通过post发送我想要发送的内容呢。谢谢

------解决方案--------------------
doc.All.Item("username").value="sdfsdf23"
------解决方案--------------------
ebBrowser1.Document.getelementbyid("username").InnerText = "sdfsdf23"
------解决方案--------------------
关于POST

http://hi.baidu.com/testvbpro/blog/item/5cced5101cd4a5f6c2ce7972.html
现在我们要用到的也是WebBrowser的“Navigate”方法,其函数原型如下所示:

Sub Navigate(URL As String, [Flags], [TargetFrameName], [PostData], [Headers])

大家不妨与第三章中Internet Explorer对象的“Navigate”方法比较一下,一模一样,原来是同一个接口!!

新建一个工程,部件中勾选中 “Microsoft Internet Controls”,添加一个WebBrowser1、一个Command1在窗体上,可以把WebBrowser1适当拉大一点,Form1中添加以下代码:
VB code
      Private Sub Command1_Click()

      ReDim aByte(0) As Byte ' Array of bytes to hold data to post

      cPostData = "login_name=帐号&password=密码&cookietime=0&x=42&y=10"

      PackBytes aByte(), cPostData

      Dim vPost As Variant

      vPost = aByte ' Assign the byte array to a VARIANT

      Dim vHeaders As Variant

      vHeaders = "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)

      WebBrowser1.Navigate "http://www.****.net/member/logon.asp", , , vPost, vHeaders

      End Sub

      Private Sub PackBytes(ByteArray() As Byte, ByVal PostData As String)

    iNewBytes = Len(PostData) - 1   ' Get rid of the null termination

      If iNewBytes < 0 Then

       Exit Sub

      End If

      ReDim ByteArray(iNewBytes)

      For i = 0 To iNewBytes

       ch = Mid(PostData, i + 1, 1)

       If ch = Space(1) Then

        ch = "+"

       End If

       Debug.Print ch, Asc(ch)

       ByteArray(i) = Asc(ch)

      Next

    End Sub

------解决方案--------------------
直接用form名称.submit()进行提交即可。