2010-04-28 32 views
0
<html> 
<body> 
<%@ Language=VBScript ENABLESESSIONSTATE = False%> 
<form Name="sushant" method="post" action="sushant.asp"> 
<select id="selFiles" name="selFiles" class="Select" style="width: 250px" tabindex="130"> 

<% 

Dim fso, folder, files 

Set fso=Server.CreateObject("Scripting.FileSystemObject") 

Set folder=fso.GetFolder("C:\") 

Set files=folder.Files  
For each folderIdx In files 

    Response.Write("<option>" + folderIdx.Name + "</option>") 

Next 

%> 
</select> 
</body> 
</html> 

我想通過在另一個文件中的鏈接來嘗試此代碼。但在執行IE顯示線集fso = Server.createobject錯誤.....我試圖但我找不到錯誤。誰能幫我嗎。抱歉格式問題。a databind下拉列表

+0

什麼是實際的錯誤代碼? – edosoft 2010-04-28 07:18:54

+0

服務器對象,ASP 0177(0x8007007E) 8007007e – sushant 2010-04-28 07:24:04

+0

我試過你的代碼在我的機器上,它的工作。我不認爲這是你的代碼。服務器上一定有問題。 – Kosta 2010-04-29 13:57:16

回答

0

通常,如果系統無法找到註冊的對象,您將會得到該錯誤。給

regsvr32 %windir%\system32\scrrun.dll 

一去,看看它是否排序你。

我也看到了這個問題,特別是與FSO,在一個AV軟件似乎阻止它的服務器上,所以檢查了這一點。