vb net如何将循环添加到webrequest参数 [英] vb net how to add loop to a webrequest parameter

查看:78
本文介绍了vb net如何将循环添加到webrequest参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在webrequest代码中添加一个带变量的循环:

 rivate  Sub  Button1_Click( sender  As   Object ,e  As  EventArgs) 句柄 Button1.Click 
Dim i As 整数
用于 i = 200 234
Dim request As WebRequest = WebRequest.Create( http://cpanel.*******.gr/api/*********/dlr.php?id = i& ; uname = ********& pass = ********

' 将请求的Method属性设置为POST。
request.Method = POST





这是正确的id的语法?我想将int32 vb net'i'变量添加到webrequest

 ********* / dlr.php?id = i& 

解决方案

尝试如下

  Dim 请求 As  WebRequest = WebRequest.Create(  http:// cpanel。*******。gr / api / ********* / dlr.php?id =& i.ToString()&  & uname = ********& pass = ********


I want to add a loop with variables to a webrequest code :

rivate Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim i As New Integer
        For i = 200 To 234
            Dim request As WebRequest = WebRequest.Create("http://cpanel.*******.gr/api/*********/dlr.php?id=i&uname=********&pass=********")

            ' Set the Method property of the request to POST.
            request.Method = "POST"



is this the right syntax for id? I want to add the int32 vb net 'i' variable to the webrequest

*********/dlr.php?id=i&

解决方案

try as below

Dim request As WebRequest = WebRequest.Create("http://cpanel.*******.gr/api/*********/dlr.php?id="&i.ToString()&"&uname=********&pass=********")


这篇关于vb net如何将循环添加到webrequest参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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