• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

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;
            }
        }
0
smares323
Asked:
smares323
  • 2
1 Solution
 
Russ SuterCommented:
You haven't declared Simulate anywhere in your code block. The compiler has no idea what it is.
0
 
smares323Author Commented:
How do i declare the Mid

  public static partial class Simulate
        {
           
        }
0
 
Russ SuterCommented:
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.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now