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

Posted on 2014-08-26
Last Modified: 2014-08-26
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;
                DocFileStr = GroupName + FileStr; //DocFilePath & GroupName & FileStr
                return DocFileStr;
Question by:smares323
    LVL 19

    Accepted Solution

    You haven't declared Simulate anywhere in your code block. The compiler has no idea what it is.

    Author Comment

    How do i declare the Mid

      public static partial class Simulate
    LVL 19

    Expert Comment

    by:Russ Suter
    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.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now