dongsuo0517
dongsuo0517
2017-02-01 06:00
浏览 41
已采纳

如何将PHP代码转换为vb.net for循环

how do i convert this php code to vb im trying to do this in .net but the value is only 1 value what is the code of .net using my php codes

this is my code in php

              $ctr = 7 
              for ($i = 0;$i < $ctr;$i++) 
                { 
                    $prenum .= '0';
                } 

output = 0000000

    Dim prenum as string = "0"
    Dim ctr as Integer = 7
    For i = 0 To ctr
        output = prenum
    Next

output = 0

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanpan3166
    duanpan3166 2017-02-01 06:10
    已采纳

    the operator '.' in php concatenates strings, the operator for vb to concatenate is '&'...

    Dim prenum as string = "0"
    Dim ctr as Integer = 7
    For i = 0 To ctr
        output = output & prenum
    Next
    
    点赞 评论

相关推荐