GVKun编程网logo

asp-classic – 在Classic ASP中的应用程序范围中使用字典对象(asp dictionary)

17

关于asp-classic–在ClassicASP中的应用程序范围中使用字典对象和aspdictionary的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于asp-classic–ASPC

关于asp-classic – 在Classic ASP中的应用程序范围中使用字典对象asp dictionary的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于asp-classic – ASP Classic中的溢出、asp-classic – asp classic:获取位于管理文件夹中的文件的当前路径、asp-classic – ASP中的Access-Control-Allow-Origin、asp-classic – Checkbox布尔值Classic ASP等相关知识的信息别忘了在本站进行查找喔。

本文目录一览:

asp-classic – 在Classic ASP中的应用程序范围中使用字典对象(asp dictionary)

asp-classic – 在Classic ASP中的应用程序范围中使用字典对象(asp dictionary)

从 my last question开始跟进有没有人知道如何在Classic ASP中的应用程序范围内使用字典对象?您不能使用Scripting.Dictionary – 如果您尝试,您将看到类似于以下内容:

Application object error 'ASP 0197 : 80004005'
disallowed object use /xxx.asp,line 2. Cannot add object with apartment model behavior to the application intrinsic object.

我在(好的)’4GuysFromrolla上找到了this article,但是它指向Microsoft’s free Lookup Component和free Dictionary Component from Caprock Consulting – 两者都是死链接.

这篇文章清楚地解释了为什么你不能在应用程序范围内使用Scripting.Dictionary,但我想知道是否有人知道一个免费替代品或者我可能找到4GuysFromrolla提到的旧组件的副本?

解决方法

我可以使用以下链接从Caprock Consulting下载Dictionary Component: http://web.archive.org/web/20000619122506/http://www.caprockconsulting.com/data/CaprockDCT.zip

asp-classic – ASP Classic中的溢出

asp-classic – ASP Classic中的溢出

我想知道是否有人可以帮助我,因为我已经对我认为是一个简单错误的简单原因视而不见.

我有这个代码:

doRound1(x1)
  denom1 = 5
  y1 = denom1 - x1 mod denom1
  if y1 <> denom1 then
    x1= x1+y1
  end if

  doRound1=x1
 End function

 'theCalc = 20488888888.684
  theCalc = cDbl(11111111111) * 1.844
  doRound1(theCalc)

我收到这个错误

Microsoft VBScript runtime  error '800a0006'
Overflow: 'x1'

在上面的代码中由此行引起:

y1 = denom1 - x1 mod denom1

有任何想法吗?就像我说的那样,我今晚已经失明了.

解决方法

答案似乎是在 PRB: “Overflow” with Integer Division and MOD Operator:

The Visual Basic Help topic for the
Mod operator and the integer division
operator () explains that if floating
point numbers are used in the
expression,they are converted to
Longs first. Thus,if the floating
point number is greater than the
maximum value of a Long
(2,147,483,647),or less than the
minimum value for a long
(-2,648),an overflow error
will occur.

答案也在那里提供:

The following code demonstrates how to
perform integer division and modulo
arithmetic when the size of an operand
is sufficiently large to cause
overflow:

Dim dblX as Double
Dim dblY as Double
dblX = 2147483648                ' numerator
dblY = 123                       ' denominator

' round off the numerator and denominator (ensure number is .0)
dblX = INT(dblX + .5)         
dblY = INT(dblY + .5)      

' Emulate integer division
MsgBox FIX(dblX / dblY)             
' Emulate modulo arithmetic
MsgBox dblX - ( dblY * FIX(dblX / dblY) )

asp-classic – asp classic:获取位于管理文件夹中的文件的当前路径

asp-classic – asp classic:获取位于管理文件夹中的文件的当前路径

我有一个文件位于一个文件夹,其完整路径是这样的:

\mymachine\mydrive$\Inetpub\wwwroot\myfolder

是否可以通过asp serverVariables获得相同的值?我害怕在我的源代码中暴露上面的路径.谢谢!

解决方法

如果有人想知道我找到了解决方案.我用了

Server.MapPath(".")

asp-classic – ASP中的Access-Control-Allow-Origin

asp-classic – ASP中的Access-Control-Allow-Origin

我有一个“DOM”文件,在另一个域上调用ASP文件(不是.NET).
如何在ASP中编写“Access-Control-Allow-Origin”?
Access-Control-Allow-Origin用于“ PHP”,但我无法找到ASP的语法,我只能在ASP.NET中找到它

当我使用Internet Explorer时它工作正常,但在Chrome中它说“请求资源上没有’Access-Control-Allow-Origin’标题.因此不允许原点’http://SOURCEDOMAIN‘访问.”

解决方法

将HTTP标头添加到Classic ASP是一个简单的过程,Response对象有一个专门用于此目的的方法,允许您将所需的任何自定义标头添加到HTTP标头中,这些标头将在请求页面时发送到浏览器.

这个方法名为AddHeader(),这里是一个例子;

<%
Call response.addheader("Access-Control-Allow-Origin","http://SOURCEDOMAIN")
%>

有用的链接

> W3 – Cross-Origin Resource Sharing
> Cross-domain Ajax with Cross-Origin Resource Sharing
> Using CORS

asp-classic – Checkbox布尔值Classic ASP

asp-classic – Checkbox布尔值Classic ASP

我有一个复选框
<input type="checkBox" name="chkNGI" id="prod_ngi_sn" value="1">

检查时,我传递值1,但是当没有检查时,传递任何值.
我必须传递值0.

我试过了

<input type="checkBox" name="chkNGI" id="prod_ngi_sn" <%if prod_ngi_sn.checked then value="1" else value="0" end if%>>

但没有奏效.

TKS

解决方法

复选框仅在勾选时传递值.您需要服务器端的逻辑来适应这种情况.
Dim chkNGI
chkNGI = Request("chkNGI") & ""
If chkNGI = "" Then
    chkNGI = "0"
End If

关于asp-classic – 在Classic ASP中的应用程序范围中使用字典对象asp dictionary的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于asp-classic – ASP Classic中的溢出、asp-classic – asp classic:获取位于管理文件夹中的文件的当前路径、asp-classic – ASP中的Access-Control-Allow-Origin、asp-classic – Checkbox布尔值Classic ASP的相关信息,请在本站寻找。

本文标签: