简体   繁体   English

Multi.Dictionary 组件过期了,可以用Scripting.Dictionary 代替吗?

[英]The Multi.Dictionary component has expired can it be replaced with Scripting.Dictionary?

I was using the MOTO BIT Mdict as my dictionary component, putting all my translations in the Application object as per the below code, and it worked fine, until the component expired 2 days ago for unknown reasons, 12 years later on.我使用 MOTO BIT Mdict 作为我的字典组件,按照下面的代码将我所有的翻译放在应用程序 object 中,它工作正常,直到组件在 2 天前因未知原因过期,12 年后。

The MOTO Bit website is not replying - so now I seek help if anyone knows how I can reprogram the code below to use with the build in asp scripting.dictionary instead. MOTO Bit 网站没有回复 - 所以现在我寻求帮助,如果有人知道我如何重新编程下面的代码以与 asp scripting.dictionary 中的构建一起使用。 Is it possible at all?有可能吗?


Function Write(strID, Comment)

    If ValidNumber(strID) Then
        If (IsObject(Application("Translation_" & StoryCountry)) = False) OR Debugf = True Then

            SET objDic = Server.CreateObject("Multi.Dictionary")
            'Load the translations into the dic object
            set toRs = conn.execute("EXEC dbo.GetTranslationsByCountryID " & StoryCountry)
                If Not toRs.Eof Then
                    tRow = toRs.GetRows()

                        For tx = 0 To UBound(tRow, 2)
                            IF objDic.Exists(tRow(0, tx)) THEN
                            ELSE
                                strTranslationKey = tRow(0, tx)
                                strTranslationText = tRow(1, tx)

                                objDic.Add strTranslationKey, strTranslationText
                            END IF

                        Next
                    SET Application("Translation_" & StoryCountry) = objDic
                End If
            Set toRs = Nothing

        End If
        Write = Application("Translation_" & StoryCountry)(strID)
    Else
    Write = "Invalid"
    End If
End Function

Unfortunately, Lord Svendson, using Scripting.Dictionary objects at the Application level is not allowed.不幸的是,Svendson 勋爵不允许在应用程序级别使用 Scripting.Dictionary 对象。 When you attempt to SET Application("Translation_" & StoryCountry) = objDic , it errors for this reason.当您尝试SET Application("Translation_" & StoryCountry) = objDic时,它会因此出错。 You will need to find a workaround to using Scripting.Dictionary您将需要找到使用 Scripting.Dictionary 的解决方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IIS在尝试使用XAMPP Apache服务器时已替换“ localhost” - IIS has replaced “localhost” when trying to use XAMPP apache server 超时已过期。 从该组获得连接之前,超时时间已过 - Time-out has expired. The time-out period has expired before a connection was obtained from the group 出现错误错误:字典中不存在给定的键。 在生产中 - Getting error Error: The given key was not present in the dictionary. in production 将文件复制到AWC EC2 Windows服务器上的FTP服务器失败,并显示“无法建立数据连接:连接等待时间已到期” - Copying files to an FTP server on AWC EC2 Windows server fails with “Unable to build data connection: The connection waiting time has expired” 使用服务器端脚本分隔符 (&lt;% %&gt;) 会导致运行时编译吗? - Can using server-side scripting delimiters (<% %>) cause compilations during runtime? IIS 池回收后的对话参考(并发字典变为空白) - conversation reference (concurrent dictionary become blank) after IIS pool recycle 将过期的HTTP重定向到HTTP - Redirect Expired HTTPs to HTTP IIS的IdleTimeout是否会使Session过期? - Will Session be expired by IdleTimeout of IIS? qpdf已开始在qpdf_init()上抛出“外部组件抛出异常” - qpdf has started throwing “External component has thrown an exception” on qpdf_init() IIS 缓存文件从未被替换 - IIS cached files never replaced
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM