Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using the code is
C#
string source = txt_Files.Text;


button_upload

C#
 string dest = "d:\\\\uploadfiles\\";
                string filename = txt_targetfile.Text;
               // string fileformet = combo_fileformet.SelectedItem.ToString();
                string givenfile = dest + filename;
                File.Copy(source, givenfile + (new FileInfo(source).Extension));
                string qury = "";
                qury = "insert into Upload_db values('" +                  txt_Fileid.Text + "','" + givenfile+ "')";
                Db_class.cls_conn.affct_qry(qury);
                MessageBox.Show("success");
                txt_Fileid.Clear();
                txt_targetfile.Clear();
view_treeview


String way = treeView_uploadFile.SelectedNode.Text.ToString();
 Process.Start(way);





But i got a "error" is your path is wrong......c'nt find find your path
Posted
Updated 24-Jan-12 2:52am
v2
Comments
Jαved 24-Jan-12 8:53am    
Added pre tag.

Use:
C#
string dest = @"d:\uploadfiles\";

BTW instead of:
C#
(new FileInfo(source).Extension));

use
C#
Path.GetExtension(source);
 
Share this answer
 
v3
Comments
fjdiewornncalwe 24-Jan-12 10:22am    
Just added pre tags to the answer.
Hi
Instead of

string dest = "d:\\\\uploadfiles\\";


Use

string dest = "d:\\uploadfiles\\";


Thanks
Vinod Satapara
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900