TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
prabhat khadka
NA
14
21.6k
copy multiple file
Nov 30 2007 7:21 AM
I have written a code that copies one file of a folder using byte[].Code is below:
private static void sendFile()
{
string folderpath = @"c:\screenshot\ram.jpeg";
try
{
// DirectoryInfo di = new DirectoryInfo(folderpath);
// FileInfo[] fi = di.GetFiles();
// foreach(FileInfo Finfo in fi)
{
FileStream fs;
fs = new FileStream(folderpath,FileMode.Open);
byte[] byteFile = new byte[fs.Length];
fs.Read(byteFile,0,byteFile.Length);
fs.Close();
getbyte(byteFile, "ram");
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
}
private static void getbyte(byte[] mybte,string filename)
{
byte [] byteFile= mybte;
// LogManager.managelog("file name requested is" +line);
FileStream fs;
string saveTo=@"C:\copyPath";
fs = new FileStream(saveTo + @"\" + filename,FileMode.Create);
fs.Write(mybte, 0, byteFile.Length);
fs.Close();
}
}
How to copy the whole .jpeg files from the screenshot folder to copypath folder??
Thanx in advance.
Reply
Answers (
2
)
How to SendInput without using User32.dll
Login to Windows Programmatically