Share the class of "resource files to make multilingual version"

xiaoxiao2021-03-06  78

I saw Yang Yun sent ""

Use the resource file to make a multi-language version of the software, "feeling, the method is not very convenient, share my

Resource file class

In fact, this Class is

HTMLDitor3.1 has been used

Sealed Class Manager

#Region SeaLed Class Manager / ** ////

/// Implementing the H /// /// //// ////// //// < Remarks> /// Temporary Language Information Resources /// Create By Lion /// 2004-08-11 11:56 /// Support .NET Framework v1.1.4322 /// When calling thread.curentthread.curentuiculut to the class, it can be //// /// Private private static hashtable _resources; /////// /// manager constructor /// /// Resource Name /// /// Returns the value of the specified /// // / Resource Name /// Resource Name /// for the current regional setting of the caller The value of localized resources. If you can't have a match, return a null reference (Nothing in Visual Basic). The resource value can be empty reference (Nothing). /// Name parameter is an empty reference (Nothing in Visual Basic). /// The available resource set is not found, and there is no non-specific regional resource.

/// /// The following code demonstrates how to call /// /// String str = getObject (resxname, name); //// /// public static object (String resxname, string name) {return getObject (resxname, name, null);} / ** ////

// Returns specified value //// /// /// Resource Name // / The resource name to get /// object, it indicates that the resource is localized As the region. Note that if this resource has not been localized for this region, lookup will use the regional Parent attribute to roll back and stop after checking in a particular language area. If the value is an empty reference (Nothing in Visual Basic), use the regional Currentuicultuiculture property to obtain the value of CultureInfo /// to specify the localized resource. If you can't have "best match", return the empty reference (Nothing in Visual Basic). /// Name parameter is an empty reference (Nothing in Visual Basic). /// The available resource set is not found, and there is no non-specific regional resource.

/// /// The following code demonstrates how to call /// /// Object o = getObject (resxname, name, culture); / // /// public static object GetObject (string resxName, string name, CultureInfo culture) {EnsureResources (resxName); ResourceManager res = _resources [resxName] as ResourceManager; if (! res = null) Return Res. GetObject (Name, Culture); Return Null;} / ** ////

// Returns the value of the specified /// / // /// The resource name to get. /// The value of the localized resource for the current regional setting of the caller. If you can't have a match, return a null reference (Nothing in Visual Basic). /// Name parameter is an empty reference (Nothing in Visual Basic). /// The available resource set is not found, and there is no non-specific regional resource. /// Specifies the value of the resource is not a string.

/// /// The following code demonstrates how to call /// /// string str = getString (resxname, name); ////////// /// public static string getString (String resxname, string name) {return getString (resxname, name, null);} / ** ////

// returned to specified 资 /// /// /// Resource Name // / The resource name to get. /// object, it represents the regionality that the resource is localized. Note that if this resource has not been localized for this region, lookup will use the regional Parent attribute to roll back and stop after checking in a particular language area. If the value is an empty reference (Nothing in Visual Basic), use the regional Currentuicultuiculture property to obtain the value of CultureInfo /// to specify the localized resource. If it is impossible to have the best match, return the empty reference (Nothing in Visual Basic). /// Name parameter is an empty reference (Nothing in Visual Basic). /// The available resource set is not found, and there is no non-specific regional resource. /// Specifies the value of the resource is not a string.

转载请注明原文地址:https://www.9cbs.com/read-89050.html

New Post(0)