Server.DataStorage.MakeResourceMap C# (CSharp) Méthode

MakeResourceMap() public méthode

public MakeResourceMap ( ) : string
Résultat string
        public string MakeResourceMap()
        {
            string mapPath = Directory.GetCurrentDirectory();
            string mapName = "ResourceMapMeasurements";
            String[] split = mapPath.Split(Path.DirectorySeparatorChar);

            //search for the server map, exsists in every repository
            int number = 0;
            for (int i = 0; i < split.Length; i++)
            {
                if (split[i].ToLower() == "server")
                {
                    number = i;
                    break;
                }
            }

            //make the path to the server map
            mapPath = "";
            for (int i = 0; i < number+1; i++)
            {
                mapPath += split[i]+@"\";
            }

            //make the path to the resource map
            mapPath = Path.Combine(mapPath,mapName);

            if (!Directory.Exists(mapPath))
            {
                Directory.CreateDirectory(mapPath);
            }

            return mapPath + "\\";
        }