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
Sara Jacob
NA
40
3.2k
Creating copy of uploaded file
Mar 16 2019 12:19 AM
How to create a copy of a file that is uploaded using OpenFileDialog Box .I have to save that copy in a folder.
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog op1 = new OpenFileDialog();
op1.Multiselect = false;
op1.InitialDirectory = Application.StartupPath;
op1.ShowDialog();
op1.Filter = "allfiles|*.bin";
if (op1.ShowDialog() == DialogResult.OK)
{
string name = op1.FileName;
MessageBox.Show("FileName is", name);
System.IO.File.Copy(name, Path.Combine(Path.GetDirectoryName(name), Path.GetFileNameWithoutExtension(name) + ".bin"));
//op1.Save(Application.StartupPath + @"\Code_" + DateTime.Now.ToString("d_MM_yy_HH_mm_ss") + ".bin");
}
}
Reply
Answers (
4
)
Trying to insert multiple rows data of Dataset in a table.
Two observal collection to remove an item