string strFileURL = "http://servername/sites/TestSite/TestLib/Text.xml ";
WebClient webClient = new WebClient();
webClient.Credentials = CredentialCache.DefaultCredentials
using (StreamReader reader = new StreamReader(webClient.OpenRead(strFileURL))
{
XDocument Xdoc = XDocument.Parse(reader.ReadToEnd());
}
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(string.Format("<
root
>{0}</
>",reader.ReadToEnd));
string value = xmlDocument.SelectSingleNode("root/app.Status").InnerText;
ClientContext context = new ClientContext("http://servername/sites/TestSite");
context.ExecuteQuery();
Uri testuri = new Uri(strFileURL);
FileInformation info = File.OpenBinaryDirect(context, testuri.AbsolutePath);
using (StreamReader reader = new StreamReader(info.Stream))
xDoc = xdoc.ToXmlDocument();
string site = "http://servername/sites/TestSite";
using(SPSite spsite = new SPSite(site))
using(SPWeb spweb = spsite.OpenWeb())
SPFile file = spweb.GetFile(strFileURL);
StreamReader reader = new StreamReader(file.OpenBinaryStream());
XDocument xdoc = XDocument.Parse(reader.ReadToEnd());
reader.Close()
}}
Maheshkumar S Tiwari edited Original. Comment: Added code blocks and Tags