restrict access to folder for particular user . using vb.net.In an variable am passing username and pwd . but at that line am getting error like mentioned in the above.the variable mailid and pwd contain some value like xx and yy
code
----
Dim FolderPath As String = "D:\ABC\2011\TAccount\HA\" 'Specify the folder here
Dim UserAccount As String = mailid \ pwd
Dim FolderInfo As IO.DirectoryInfo = New IO.DirectoryInfo(FolderPath)
Dim FolderAcl As New DirectorySecurity
FolderAcl.AddAccessRule(New FileSystemAccessRule(UserAccount, FileSystemRights.FullControl, InheritanceFlags.ContainerInherit Or InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Deny))
FolderInfo.SetAccessControl(FolderAcl)
try changing your line to the following……..
Basically from i can understand it is taking your string declaration as a SUM and trying to DIVIDE mailid BY pwd so therefore its thinking its a string and trying to convert it to a number.