An object-oriented programming language developed by Microsoft that can be used in .NET.
Convert Powershell script to VBNet
Param(
[Parameter(Mandatory=$true,
ValueFromPipeline=$true)]
[string]
$SixDigitRestaurantCode
)
try
{
if(($SixDigitRestaurantCode -ne $null) -and ($SixDigitRestaurantCode.Length -eq 6)
-and (($SixDigitRestaurantCode.ToUpper().Substring(0,2) -eq "C0")
-or ($SixDigitRestaurantCode.ToUpper().Substring(0,2) -eq "MG")))
{
$addr = [String]::Format("{0}BServer",$SixDigitRestaurantCode)
$res = [Net.DNS]::GetHostAddresses([String]::Format("{0}BServer",$SixDigitRestaurantCode))
return $addr
}
else {
return "Invalid SixDigitRestaurantCode"
}
}
catch
{
$addr = [String]::Format("{0}Server",$SixDigitRestaurantCode)
return $addr
}
Could someone help me to convert the above PS script to VBNet.