本地语言的布尔值

Hug*_*ing 8 iis-7 locale asp-classic windows-7-x64

这个问题很久以前就曾在serverfault问过,但没有工作的awnser.我希望有人遇到它并从那时起找到解决方案.

例:

<%
Response.Write True
Response.Write "<hr>"
Response.Write "test:" & True
%>
Run Code Online (Sandbox Code Playgroud)

输出:

True
--------------
test:Waar
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,只要您合并输出,它就会变成一个本地字符串('Waar'是荷兰语为true).我需要它保持"真实".

我怎么能改变这个?我不介意在页面的开头放置一些代码,但我无法更改True整个代码中的所有实例.所以创建一个像下面这样的函数来返回正确的字符串不会.

Function PB(pVal)
  If pVal Then
    PB = "true"
  Else
    PB = "false"
  End If
End Function
Run Code Online (Sandbox Code Playgroud)

G. *_*nev 3

我做了类似的事情,但目前没有机器来测试你的情况:

<%
Response.Write FormatDateTime(Now) & "<br />"
oldLocale = SetLocale(1026) 'Bulgarian
Response.Write FormatDateTime(Now) & "<br />"
SetLocale oldLocale 
Response.Write FormatDateTime(Now) & "<br />"
%>
Run Code Online (Sandbox Code Playgroud)

...从另一个问题来看,上面的方法似乎不起作用。

如果您尝试这些: Response.Write "test:" & CStr(True)Response.Write "test:" & Trim(True) 使用或不使用 SetLocale,会发生什么?