从支持多行而不删除的按钮向文本框添加文本

时间:2013-03-22 23:37:22

标签: vb.net

基本上我想要做的就是点击一个按钮,这会将我的文本放入文本框并在其后添加?xml = 1。如果有人想帮助我完成整个事情,那么图像低于我想要它做的事情

我的意思是http://i.stack.imgur.com/2eatj.png

看看它看起来像http://i.stack.imgur.com/aCoJ0.png但是每次我点击?xml = 1它都会添加到底部这不重要我在哪一行点击它只是将它添加到最后

我用于?xml = 1的部分是TextBox1.Text& =“?xml = 1” {Public Class Form1

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
    TextBox1.Text &= "?xml=1"
End Sub

结束课程}

1 个答案:

答案 0 :(得分:1)

您的表单不完整,生成Steam64Id号码需要各种信息。

即,您需要“Universe”,“AccountType”,“AccountInstance”和“课程编号”。

当您将组件值的值放在一起时,最终会得到Steam64Id数字。

您可以在下面的图片中查看它是如何分解的。

Breakdown of Steam64Id number

可在蒸汽开发者页面上找到更多信息

https://developer.valvesoftware.com/wiki/SteamID

更新

如果输入帐号的文本框名为txtSource,输入的0123456789作为数字,并且在添加“?xml = 1”后要将其写入的文本框称为txtDestination,则将其传输的代码为

txtDestination.text = txtSource.text & "?xml=1"

如果你想在添加网址时将其转移,那么它将是

txtDestination.text = "http://steamcommunity.com/ID/" & txtSource.text & "?xml=1"

txtDestination.text = "http://steamcommunity.com/PROFILES/" & txtSource.text & "?xml=1"

还有一些未解决的问题,因为您还没有澄清它是ID还是个人资料,所以当您将其重写为网址时,它将是http://steamcommunity.com/ID/0123456789?xml=1或者是http://steamcommunity.com/PROFILES/0123456789?xml=1我的猜测是只有一个是正确的而另一个是错的。

一旦你得到了正确的文件夹,其ID或配置文件成功调用将返回一个XML文档,你必须从中提取数据。

更新II

我今天有空闲时间,所以我设法淘汰了这个代码,它与图像进一步向下,我没有时间做网页刮痧,但我相信会有很多关于其他用户提出类似问题的地方的例子。希望这足以让你顺利上路。

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Dim Reference As Long

  If Trim(TextBox1.Text) <> "" Then
    If IsNumeric(TextBox1.Text) Then
      Reference = Shell("c:\program files\internet explorer\iexplore.exe http://steamcommunity.com/profiles/" & Trim(TextBox1.Text) & "?xml=1")
    Else
      Reference = Shell("c:\program files\internet explorer\iexplore.exe http://steamcommunity.com/id/" & Trim(TextBox1.Text) & "?xml=1")
    End If
  Else
    MsgBox("No steam Id entered!", MsgBoxStyle.Critical, "Error")
  End If

End Sub


Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click

  If Trim(TextBox2.Text) <> "" Then
    TextBox3.Text = "http://steamcommunity/friends/add/" & TextBox2.Text
  Else
    MsgBox("No steam 64 Id specified!", MsgBoxStyle.Critical, "Error")
  End If

End Sub


Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click

Dim Reference As Long

  If Trim(TextBox3.Text) <> "" Then
    Reference = Shell("c:\program files\internet explorer\iexplore.exe " & Trim(TextBox3.Text))
  Else
    MsgBox("No steam 64 Id specified!", MsgBoxStyle.Critical, "Error")
  End If

End Sub

enter image description here