本文介绍了C#.net Windows应用程序中的路径标识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的代码是

i am using the code is

string source = txt_Files.Text;



button_upload



button_upload

 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);






但是我遇到了错误",是您的路径错误了……c''nt找不到您的路径






But i got a "error" is your path is wrong......c''nt find find your path

推荐答案

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


BTW代替:


BTW instead of:

(new FileInfo(source).Extension));


使用


use

Path.GetExtension(source);


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



使用



Use

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



谢谢
Vinod Satapara



Thanks
Vinod Satapara


这篇关于C#.net Windows应用程序中的路径标识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 19:42