本文介绍了从VB6.0将代码转换为vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

请将以下代码从Vb 6.0转换为Vb.Net.


非常感谢您提供的解决方案.

strCardCode = Right("00000000" & Right("0000" & Hex(Val(txtFacilityCode.Text)), 4) & Right("0000" & Hex(i), 4), 8)


谢谢&问候,
Tirupati Jogu

Hi Guys,

Please convert below code from Vb 6.0 to Vb.Net.


Greatful yo those you provide solution .

strCardCode = Right("00000000" & Right("0000" & Hex(Val(txtFacilityCode.Text)), 4) & Right("0000" & Hex(i), 4), 8)


Thanks & Regards,
Tirupati Jogu

推荐答案

string strCardCode = Integer.Parse(txtFacilityCode.Text).ToString("X4") & i.ToString("X4")


Dim Test1 As Integer
     Dim Test2 As Integer=0
     Dim Test3 As Integer=0
     Dim Test4 As Integer=0

     If My.Computer.Network.Ping("www.google.com") = True Then
         Test1 = 1
     ElseIf My.Computer.Network.Ping("www.google.com") = False Then
         Test1 = 0
     End If

     If My.Computer.Network.Ping("www.yahoo.com") = True Then
         Test2 = 1
     ElseIf My.Computer.Network.Ping("www.yahoo.com") = False Then
         Test2 = 0
     End If

     If My.Computer.Network.Ping("www.bing.com") = True Then
         Test3 = 1
     ElseIf My.Computer.Network.Ping("www.bing.com") = False Then
         Test3 = 0
     End If

     Test4 = Test1 + Test2 + Test3

     If Test4 > 0 Then
         MessageBox.Show (Test4 & " ping requests responded to.")

     Else

         MessageBox.Show ("No pings responded to.")

     End If


这篇关于从VB6.0将代码转换为vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 17:06