S
stephen
Hi,
I have been working using VB .NET and I wanted to convert a code to C#
in VB .Net I use modules so that I can declare variables, STP holders so
that I can replace them easily when I move b/w Dev and Prod like this
Module modAVSVariables
'Arraylist and Array Variables
Friend pathArray As Array
Friend temp_arrAllFiles As Array
Friend getPath As ArrayList = New ArrayList
End Module
....................and access them like this in Classes like this:
Public Class HelperClass
Friend Function getPaths() As Boolean
nvc = CType(ConfigurationSettings.GetConfig("Key"),
NameValueCollection)
For Each key As String In nvc.Keys
If nvc(key) = "" Then
_fileError.KeyError("Missing Path", "Key", key)
Return False
Else
getPath.Add(nvc(key))
End If
Next
Return True
End Function
Friend function getFiles() as Boolean
temp_arrAllFiles = System.IO.Directory.GetFiles(getPath(0))
End Function
End Class
.... and so on....
whats the equivalent of "module" in C# where i can declare them....
Thanks,
Stephen
I have been working using VB .NET and I wanted to convert a code to C#
in VB .Net I use modules so that I can declare variables, STP holders so
that I can replace them easily when I move b/w Dev and Prod like this
Module modAVSVariables
'Arraylist and Array Variables
Friend pathArray As Array
Friend temp_arrAllFiles As Array
Friend getPath As ArrayList = New ArrayList
End Module
....................and access them like this in Classes like this:
Public Class HelperClass
Friend Function getPaths() As Boolean
nvc = CType(ConfigurationSettings.GetConfig("Key"),
NameValueCollection)
For Each key As String In nvc.Keys
If nvc(key) = "" Then
_fileError.KeyError("Missing Path", "Key", key)
Return False
Else
getPath.Add(nvc(key))
End If
Next
Return True
End Function
Friend function getFiles() as Boolean
temp_arrAllFiles = System.IO.Directory.GetFiles(getPath(0))
End Function
End Class
.... and so on....
whats the equivalent of "module" in C# where i can declare them....
Thanks,
Stephen