This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | |
Stream responseStream = response.GetResponseStream(); | |
StreamReader myStreamReader = new StreamReader(responseStream, Encoding.Default); | |
string pageContent = myStreamReader.ReadToEnd(); | |
if (Utils.IsStringPresentInHtmlSource(pageContent, "Working on it")) | |
{ | |
Console.WriteLine("Site Collection " + url + " has been deleted"); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MSOWebPartPage_PostbackSource=&MSOTlPn_SelectedWpId=&MSOTlPn_View=0&MSOTlPn_ShowSettings=False&MSOGallery_SelectedLibrary=&MSOGallery_FilterString=&MSOTlPn_Button=none&MSOSPWebPartManager_DisplayModeName=Browse&MSOSPWebPartManager_ExitingDesignMode=false&__EVENTTARGET=ctl00$PlaceHolderMain$ctl07$RptControls$BtnDelete&__EVENTARGUMENT=&MSOWebPartPage_Shared=&MSOLayout_LayoutChanges=&MSOLayout_InDesignMode=&MSOSPWebPartManager_OldDisplayModeName=Browse&MSOSPWebPartManager_StartWebPartEditingName=false&MSOSPWebPartManager_EndWebPartEditing=false&_maintainWorkspaceScrollPosition=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string postdata = "MSOWebPartPage_PostbackSource=&MSOTlPn_SelectedWpId=&MSOTlPn_View=0&MSOTlPn_ShowSettings=False&MSOGallery_SelectedLibrary=&MSOGallery_FilterString=&MSOTlPn_Button=none&MSOSPWebPartManager_DisplayModeName=Browse&MSOSPWebPartManager_ExitingDesignMode=false&__EVENTTARGET=ctl00$PlaceHolderMain$ctl07$RptControls$BtnDelete&__EVENTARGUMENT=&MSOWebPartPage_Shared=&MSOLayout_LayoutChanges=&MSOLayout_InDesignMode=&MSOSPWebPartManager_OldDisplayModeName=Browse&MSOSPWebPartManager_StartWebPartEditingName=false&MSOSPWebPartManager_EndWebPartEditing=false&_maintainWorkspaceScrollPosition=0&__REQUESTDIGEST=" + formDigest + "&__VIEWSTATE=" + viewState + "&__EVENTVALIDATION=" + eventValidation + "&__VIEWSTATEGENERATOR=" + viewStateGenerator + "&SideBySideToken=" + sideBySideToken; | |
byte[] buffer = Encoding.UTF8.GetBytes(postdata); | |
request.ContentLength = buffer.Length; | |
request.KeepAlive = true; | |
sw = request.GetRequestStream(); | |
sw.Write(buffer, 0, buffer.Length); | |
sw.Flush(); | |
sw.Close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetHtmlSource(string siteUrl, ICredentials credentials, CookieContainer cc) | |
{ | |
string resourceUrl = siteUrl; | |
HttpWebRequest wreq = HttpWebRequest.Create(resourceUrl) as HttpWebRequest; | |
wreq.Credentials = credentials; | |
wreq.CookieContainer = cc; | |
wreq.Method = "POST"; | |
wreq.UserAgent = HtmlControlConstants.USERAGENT; | |
wreq.ContentLength = 0; | |
wreq.ContentType = HtmlControlConstants.CONTENTTYPE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SharePointOnlineCredentials credentials = GetO365Credentials(userName, password); | |
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); | |
request.Credentials = credentials; | |
request.CookieContainer = new CookieContainer(); | |
request.CookieContainer = GetO365CookieContainer(credentials, url); | |
request.Method = "POST"; | |
request.Headers.Add("Overwrite", "T"); | |
request.ContentType = "application/x-www-form-urlencoded"; | |
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; BRI/2; InfoPath.3)"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="/teams/MySCForApps/Style Library/JS/jquery-1.8.2.min.js"></script> | |
<script type="text/javascript" src="/teams/MySCForApps/Style Library/JS/jquery-ui.js"></script> | |
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script> | |
<script type="text/javascript" src="/_layouts/15/sp.js"></script> | |
<script type="text/javascript" src="/teams/MySCForApps/Style Library/JS/jquery.MultiFile.js"></script> | |
<link rel="Stylesheet" type="text/css" href="../CSS/App.css" /> | |
<script language="javascript" type="text/jscript"> | |
$(function () { | |
var fileCountCheck = 0; | |
$("#btnSubmit").click(function () { |
NewerOlder