asp有办法取到vb里某个变量的值吗,vb程序如下
asp有办法取到vb里某个变量的值吗,vb程序如下
Public Function aspexcel(ByVal SQLStr As String) As Boolean
略
Dim sfilename As String
sfilename = CStr(FormatDateTime(Now, 0))
sfilename = App.path & "\ " & sfilename & ".xls "
Set xlBook = xlApp.Workbooks.Add
xlBook.SaveAs (sfilename)
Set xlSheet = Nothing
aspexcel = True
Exit Function
End Function
------解决方案--------------------sfilename是过程内部变量,你取个鸟毛
想也不用应该再写个private的类内部变量来存储此过程内sfilename的值,然后用public的属性或函数来返回值了
------解决方案--------------------ASP可以取得VB,VC等开的组件中的PUBLIC变量,PUBLIC Property ,PUBLIC Enum对象 和方法
------解决方案--------------------obj.strOutPath是只写属性
obj.getOutPath才是只读属性
------解决方案--------------------想在程序外访问程序内申明的变量吗?昏,的确有想法.....
------解决方案--------------------Dim sfilename As String
去掉
Private sfilename
Public Property Get getOutPath()
getOutPath = sfilename
End Property
试试
------解决方案--------------------private str as string
Public Property Get GetData() '从外部取出来
GetData = str & ", OK? "
End Property
Public Sub K(m as string)
str = m
End Sub
<%
Set clsTest = Server.CreateObject( "工程名.类名 ")
clsTest.K( "Hello~ ")
Response.write clsText.GetData
Set clsTest = Nothing
%>
没试过,应该就这样吧. 你测试一下.
------解决方案--------------------App.path 可以用在Dll里吗?asp就算能输出,估计也没权限,除非你的整个服务器硬盘都是evervone有列出目录的权限