3

我发现了一个带有新 Web 服务器的泡菜。我们有一个新的网络服务器,它显示的日期与我们的旧网络服务器不同。

我们正在使用 windows server 2003 在 IIS 6.0 上运行 asp 经典网页。

我们以管理员身份登录并根据需要设置区域设置,然后将设置应用于当前用户和默认用户配置文件。

然后我们进入注册表并在 HKEY_USERS/.default/control panel/international 下更新适当的格式。

将我们网站的 asp.net 配置更新为正确的代码页和区域设置。

有没有人有其他地方可以让应用程序获取日期格式?

4

6 回答 6

2

I know this isn't the 'proper' way to fix the issue. However, the application was written many years ago, getting something through planning/change control would be a pain, and is the only application running on the server. Thus it is okay to configure the server to cater to this single application. Besides it was driving me crazy that a new server that should be configured identically to an old server was not working.

It turns out that in addition to HKEY_USERS/*/Control Panel/international, there is a setting for non-unicode programs. It can be found under HKLM/system/currentcontrolset/control/nls/language/Default. Set that to the correct code page and it is golden.

On the other hand, if you prefer to not modify the registry directly, you can update all these values through the Regional settings from the control panel.

You can adjust the formats through the 'customize' button. You can change the 'language for non-unicode programs' under advanced tab. Just make sure that you check the 'apply to the default profile' at the bottom of the advanced tab.

于 2009-07-29T22:43:23.780 回答
1

我不认为最高投票的答案是正确的,尽管它很接近。

我不得不使用 regedit 将 HKU\S-1-5-19\Control Panel\International (NT Authority) 和 HKU\S-1-5-20\Control Panel\International (网络服务) 的所有国际化设置更改为匹配已经在 HKU\S-1-5-18\Control Panel\International(本地系统)中的设置。

这非常有效。

我手动修改了所有我能看到的不同设置。

我应该认为我只需要更改 S-1-5-20(网络服务)的设置。

于 2012-02-27T17:53:11.117 回答
1

转到控制面板 -> 区域和语言选项,设置您需要的所有选项,然后在“高级”选项卡下选择非 Unicode 程序的设置并选中“将所有设置应用于当前帐户和默认用户配置文件。”。按确定并重新启动服务器。

在 Windows Server 2008 上,管理员有额外的“管理”选项卡。有按“复制到保留帐户”。

于 2015-10-31T16:06:02.320 回答
0

如果您在不同的帐户(不是 IUSR_Guest)下运行 ASP 应用程序,以该帐户登录,将日期/时间格式设置为您想要的格式并重新启动 IIS。

于 2009-08-13T07:59:50.547 回答
0

经典 ASP 默认为服务器安装时配置的区域设置 ID。如果您有权访问原始服务器,请运行以下代码以获取它正在运行的区域设置 ID,并验证新服务器是否使用相同的。

<%=Session.LCID%>

如果区域设置 ID 不同并且您无法在新服务器上更改它,那么您可以在 global.asa 中的 Session_OnStart 子中添加一行,用于将正确的区域设置 ID 分配给 Session.LCID 的应用程序。

于 2009-07-29T20:13:01.020 回答
0

使用带有内容的 ASP 页面:-

Response.Write GetLocale

可能会提供信息,它将向您展示 VBScript 认为它使用的语言环境。

在使用集成安全性时,我在昏暗而遥远的过去看到过类似的问题。当 ASP 第一次需要使用它们时,它会缓存来自用户配置单元的区域详细信息,然后继续使用这些设置,直到进程终止。ASP 从与当前运行代码的用户身份相关联的用户配置单元中获取这些设置。大多数时候这将是默认的,因为用户在系统上没有配置文件。

但是,如果用户碰巧以交互方式登录到服务器,他们将拥有一个配置文件,因此会使用他们的设置。因此,我看到了服务器似乎在区域设置方面出现间歇性问题的情况。

我不记得我是否在 IIS6 上看到过,我肯定在 IIS5 上看到过。

于 2009-07-29T20:20:28.633 回答