public ActionResult Sample14() { // Check is data posted if (Request.HttpMethod == "POST") { //### Set variables and get POST data System.Collections.Hashtable result = new System.Collections.Hashtable(); String clientId = Request.Form["clientId"]; String privateKey = Request.Form["privateKey"]; String path = Request.Form["path"]; // Set entered data to the results list result.Add("clientId", clientId); result.Add("privateKey", privateKey); result.Add("path", path); String message = null; // Check is all needed fields are entered if (clientId == null || privateKey == null || path == null) { // If not all fields entered send error message message = "Please enter all parameters"; result.Add("error", message); return View("Sample14", null, result); } else { //### Create a proper path from entered path //Reaplace dashlet's with proper dashlet "/" String properPath = path.Replace("(\\/)", "/"); //Convert string to array String[] pathArray = properPath.Split('/'); String lastFolder = ""; String newPath = ""; //Check if array content more than one element if (pathArray.Length > 1) { //Create string with proper path from array lastFolder = pathArray[pathArray.Length - 1]; newPath = String.Join("/", pathArray); } else { lastFolder = pathArray[0]; } String basePath = Request.Form["basePath"]; //Check is base path entered if (basePath.Equals("")) { //If base path empty set base path to the dev server basePath = "https://api.groupdocs.com/v2.0"; } result.Add("basePath", basePath); // Create service for Groupdocs account GroupdocsService service = new GroupdocsService(basePath, clientId, privateKey); // Get all folders from account Groupdocs.Api.Contract.ListEntitiesResult folders = service.GetFileSystemEntities("", 0, -1, null, true, null, null); decimal folderId = new decimal(); //Get folder Id if (folders.Folders != null) { for (int i = 0; i < folders.Folders.Length; i++) { if (folders.Folders[i].Name == lastFolder) { folderId = folders.Folders[i].Id; } } } //Get all sharers for entered folder Groupdocs.Api.Contract.UserInfo[] shares = service.GetFolderSharers(folderId); // Check is request return data if (shares.Length != 0) { String emails = ""; //Get all emails of sharers for (int n = 0; n < shares.Length; n++) { emails += shares[n].PrimaryEmail + "<br />"; } //Convert string to HTML string MvcHtmlString email = MvcHtmlString.Create(emails); // Return primary email to the template result.Add("shares", email); return View("Sample14", null, result); } // If request return's null return error to the template else { message = "Something is wrong with your data"; result.Add("error", message); return View("Sample14", null, result); } } } // If data not posted return to template for filling of necessary fields else { return View("Sample14"); } }