2010-04-23 25 views
0

在我的Visual Studio 2005中,我剛剛創建了一個新文件夾來恢復上傳。 我剛剛在這個文件夾中上傳了一些簡歷...現在我想檢索特定用戶的簡歷..我該如何實現這一目標?是否有任何需要創建表來存儲路徑名和檢索? ...只要解釋一下,如果可能的話,在asp.net中爲vs2005中的文件夾提供恢復簡歷的代碼。在asp.net中檢索簡歷

回答

1

我更喜歡在數據庫中存儲路徑,但並不一定。您可以保存名稱爲id的文件:resume [id] .txt。例如:resume1.txt。

using System.IO; 
using System.Text; 

... 

string folderName = "resume"; 
int resumeID = 1; //userID 
TextReader textReader = new StreamReader(Request.PhysicalApplicationPath + [email protected]"\resume"+resumeID+".txt",Encoding.UTF8); 
string resume = textReader.ReadToEnd(); 
textReader.Close(); 
+0

如何在數據庫中存儲文件路徑名 – Domnic 2010-04-23 09:57:41