How to get location path if i want to access mylocation.txt file, this file currently is in E:drive.

[CustomAction]
    public static ActionResult FillList(Session xiSession)
    {

    //Can i get store mylocation.txt into application root instead of E location
        string path = "Mylocation.txt";

        // Open the file to read from. 
        string[] readText = File.ReadAllLines(path);

        foreach (string s in readText)
        {
            //Console.WriteLine(s);
            FillComboBox(xiSession, s, s);
        }
         xiSession["COUNTRIES"] = "--Select Location--";
        return ActionResult.Success;
    }

Can i get store mylocation.txt into application root instead of E location.And how mylocation.txt can be called?Basically what i want is to get the values of combox from this text file,once installation is in progress.

有帮助吗?

解决方案

Attach the Mylocation.txt as resource file in Custom action project. Get more details from this discussion.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top