2012-11-21 62 views
0

使用下面的代碼我創建了一個快捷方式。當我運行HP fortify工具時,我得到了突出顯示的代碼的路徑操作問題。我是新手。可以請任何人告訴我如何糾正它。我的意思是操縱路徑正在發生。在C#中創建快捷方式時的路徑操作

string fileName = new data()。getdata(object_id,Cid,id_pluf).Tables [0] .Rows [0] [「Name」] +「url」;

  **var fs = new System.IO.FileStream(start + fileName, System.IO.FileMode.Create);** 
      fs.Write(bytes, 0, bytes.Length); 
      fs.Flush(); 
      fs.Close(); 

    private static void DeleteShortcut(string start, string fileName) 
     { 
      **if (System.IO.File.Exists(start+ fileName))** 
      { 

       **System.IO.File.Delete(start+ fileName);** 
      } 
     } 

回答

0

始終使用:的

Path.Combine(start, fileName) 

代替:

start+ fileName