开发者

What is C# sample code for VBScript SetLocale Function

开发者 https://www.devze.com 2023-04-11 00:39 出处:网络
I have got below code in VBScript. Sub SetPageLocale() Dim Locale Dim ContextObject Set ContextObject=getContextObject

I have got below code in VBScript.

Sub SetPageLocale()
    Dim Locale
    Dim ContextObject
    Set ContextObject=getContextObject
    Locale=getFieldValue(ContextObject.Publication.MetadataFields("Configuration").Value(1).Fields("Locale"),"")
    If Locale<>"" Then
        SetLocale(Locale)
    Else
        SetLocale("en-gb")' Move to Constants TBB
    End If

    Set ContextObject = Nothing
End Sub

Now I want to convert above code in C#. Especially I am looking for C# code for VbScript SetLocale f开发者_StackOverflowunction


In .NET you could the CultureInfo class to set the locale of the current thread:

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
0

精彩评论

暂无评论...
验证码 换一张
取 消