Link to home
Start Free TrialLog in
Avatar of smares323
smares323

asked on

C# asp.net error in Simulate.Mid(FileNameStr, SFilePosition);

I'm getting an error in the following line: Simulate.Mid(FileNameStr, SFilePosition);
of the code below: the error is: The name 'Simulate' does not exist in current context.

public string GetFileName(string FileNameStr, string GroupName)
        {
            string FileStr = null;
            string DocFileStr = null;
            Int32 FilePosition = 0;
            Int32 SFilePosition = 0;
            var SrchStr = "\\";

            //Get the filename only fromt eh FileNameString
            FilePosition = (FileNameStr ?? string.Empty).IndexOf(SrchStr) + 1;
            while (FilePosition > 0)
            {
                SFilePosition = FilePosition;
                FilePosition = (FileNameStr ?? string.Empty).IndexOf(SrchStr, FilePosition, System.StringComparison.OrdinalIgnoreCase) + 1;
            }
            FileStr = Simulate.Mid(FileNameStr, SFilePosition);
            //Merge with the document path and groupname
            //Set the full path
            if (GroupName == null || GroupName.Length == 0)
            {
                DocFileStr = FileStr; //DocFilePath & FileStr
                return DocFileStr;
            }
            else
            {
                DocFileStr = GroupName + FileStr; //DocFilePath & GroupName & FileStr
                return DocFileStr;
            }
        }
ASKER CERTIFIED SOLUTION
Avatar of Russ Suter
Russ Suter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smares323
smares323

ASKER

How do i declare the Mid

  public static partial class Simulate
        {
           
        }
Are you creating a class called Simulate? What does Mid do? What does it return? What else does the Simulate class do?

There's a big gap of information.