<%@ Page Language="VB" Debug="true" %><script runat="server">
sub Page_Load(obj as object,e as eventargs)
dim objFSO,objFile
objFSO=Server.CreateObject("Scripting.FileSystemObject")
objFile=objFSO.GetFile _
(Server.MapPath("c:\inetpub\wwwroot\day\log.txt")) lblMessage.Text=objFile.Path
end sub
</script><html><body>
<asp:Label id="lblMessage" runat="server" />
</body></html>提示错误如下:
带有 CLSID {0D43FE01-F093-11CF-8940-00A0C9054228} 的 COM 对象无效或未注册。 错误发生在Server.CreateObject处,请帮忙指点,谢谢!
sub Page_Load(obj as object,e as eventargs)
dim objFSO,objFile
objFSO=Server.CreateObject("Scripting.FileSystemObject")
objFile=objFSO.GetFile _
(Server.MapPath("c:\inetpub\wwwroot\day\log.txt")) lblMessage.Text=objFile.Path
end sub
</script><html><body>
<asp:Label id="lblMessage" runat="server" />
</body></html>提示错误如下:
带有 CLSID {0D43FE01-F093-11CF-8940-00A0C9054228} 的 COM 对象无效或未注册。 错误发生在Server.CreateObject处,请帮忙指点,谢谢!
怎么把ASP的代码拿到.NET下来用了.....
没人告诉你除了名字一样外,基本没相同之处吗....system.io.file 静态文件操作类
system.io.directory 静态目录操作类
如楼上所说.调用system.io命名空间FileStream fs= new FileStream(@"c:\abcd.txt",FileMode.Create);
然后通过fs.name来获取路径就可以.