This is a chunk of code that came in an ftp sample I downloaded from Microsoft. I've never seem the lower case 'c' used after the case select string. What is it for? In VS2010 the "u"c all shows up in red as if it were a string literal, but the c is outside the quotes.
Greg
Greg
VB.NET:
Select Case ArgChars(1)
Case "?"c
do_usage = True
Case "u"c
If (len > 2) Then
len = len - 2
szUri = New String(ArgChars, 2, len)
Else
fNeedUri = True
End If
Case "f"c
If (len > 2) Then
len = len - 2
szFileToUpload = New String(ArgChars, 2, len)
End If
Case "p"c
If (len > 2) Then
len = len - 2
szProxy = New String(ArgChars, 2, len)
Else
fNeedProxy = True
End If
Case "m"c
If (len > 2) Then
len = len - 2
szMethod = New String(ArgChars, 2, len)
Else
szMethod = "dir"
End If
Case "k"c
If (len > 2) Then
If (ArgChars(2) = "u"c) Then
If len > 3 Then
len = len - 3
szCredentials = New String(ArgChars, 3, len)
Else
do_usage = True
End If
End If
'
' these are credentials for the actual Ftp server
'
ElseIf (ArgChars(2) = "p"c) Then
'
' these are credentials for the intervening proxy server
'
If (len > 3) Then
len = len - 3
szProxyCredentials = New String(ArgChars, 3, len)
Else
do_usage = True
End If
End If
Case "v"c
fPassive = True
Case Else
Console.WriteLine("Unknown cmdline option: " + Args(i))
do_usage = True
End Select