سلام بدین شکل
البته این برای فایل هست نتوسنتی بگو برات یکی بنویسم
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace Save_file_address
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
OpenFileDialog op = new OpenFileDialog();
private void button1_Click(object sender, EventArgs e)
{
string ff = DateTime.Now.Ticks.ToString();
//Directory.CreateDirectory(op.FileName);
File.Copy(op.FileName, Application.StartupPath +ff+ op.SafeFileName);
MessageBox.Show("gg");
}
private void button2_Click(object sender, EventArgs e)
{
op.ShowDialog();
textBox1.Text = op.FileName;
textBox1.Text = Path.GetExtension(textBox1.Text);
}
}
}