Hi dude if u wanna to copy all files from your sharepoint you should save the files by the different formats like below here my code save the htm file from sharepoint to our local disk. this code snippet is working in vs .net 2005 c#.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
using
System;
using
System.Data;
using
System.IO;
using
System.Configuration;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
Microsoft.SharePoint;
using
Microsoft.SharePoint.WebControls;public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SPSite mysite = new SPSite("http://origin23:334/");
SPWeb myweb = mysite.OpenWeb();myweb.AllowUnsafeUpdates = true;
SPFolder fold = myweb.GetFolder("test/testfolder");SPFileCollection files = fold.Files;foreach (SPFile x in files)
{
Response.Write(x.Name.ToString());
if (x.Name.ToString() == "How to query all today's events in a sharepoint calendar - MSDN Forums.htm")
{
FileStream fs = new FileStream(@"D:/Accounter.htm", FileMode.Create);
BinaryWriter binaryWriter = new BinaryWriter(fs);byte[] fileData = (byte[])x.OpenBinary();
binaryWriter.Write(fileData);
binaryWriter.Close();
}
}
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>