Exemple #1
0
        public static void displayFolder(ISiteSetting siteSetting, object Item, bool inExplorer)
        {
            string url;

            if (Item as Folder != null)
            {
                url = ((Folder)Item).GetUrl();
            }
            else
            {
                SPListItem item = (SPListItem)Item;
                //if (item.FolderPath == "") item.FolderPath = item.ListName;//root item doesn't have folderpath
                //url = item.WebURL.CombineUrl(item.FolderPath);
                url = item.GetListItemURL();
            }

            if (!string.IsNullOrEmpty(url))
            {
                if (inExplorer)
                {
                    string path = "file" + url.ToLower().Replace("http", string.Empty);
                    Process.Start("Explorer.exe", path);
                }
                else
                {
                    Process.Start("IExplore.exe", url);
                }
            }
        }