I need help converting vb.net code to c#. here it is.
**Edited:**
This is what i got so far in C#
i get errors at this line:
its complaining of "Strings.IpStr( )" and "Strings.Len()" .
Error code:The name 'Strings' does not exist in the current context.
thanks in advance
Code:
'Get the ID File Type from file path name
Public Function GetFileType(ByVal fileName As String) As EFile
Dim i As Integer
For i = 0 To SFile
If InStr(1, fileName, VTFile(i).fileExt) = Len(fileName) - Len(VTFile(i).fileExt) + 1 Then
GetFileType = VTFile(i).fileID
Exit Function
End If
Next
GetFileType = EFile.NOTDEF
End Function
This is what i got so far in C#
Code:
//Get the ID File Type from file path name
public EFile GetFileType(string fileName)
{
EFile functionReturnValue = default(EFile);
int i = 0;
for (i = 0; i <= SFile; i++)
{
if (Strings.InStr(1, fileName, VTFile[i].fileExt) == Strings.Len(fileName) - Strings.Len(VTFile[i].fileExt) + 1)
{
functionReturnValue = VTFile[i].fileID;
return functionReturnValue;
}
}
functionReturnValue = EFile.NOTDEF;
return functionReturnValue;
}
Code:
if (Strings.InStr(1, fileName, VTFile[i].fileExt) == Strings.Len(fileName) - Strings.Len(VTFile[i].fileExt) + 1)
Error code:The name 'Strings' does not exist in the current context.
thanks in advance