Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> Sub ReadRessourceFile() ''#Requires Assembly System.Windows.Forms Dim rsxr As System.Resources.ResXResourceReader = New System.Resources.ResXResourceReader("items.resx") ''# Iterate through the resources and display the contents to the console. Dim d As System.Collections.DictionaryEntry For Each d In rsxr Console.WriteLine(d.Key.ToString() + ":" + ControlChars.Tab + d.Value.ToString()) Next d ''#Close the reader. rsxr.Close() End Sub </code></pre> <p>Then you need to add this to a Serializable Dictionary, which you can then serialize to JSON using System.Web.Extensions.dll</p> <pre><code>Public Class JSONHelper Public Shared Function Serialize(Of T)(ByVal obj As T) As String Dim JSONserializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer() Return JSONserializer.Serialize(obj) End Function Public Shared Function Deserialize(Of T)(ByVal json As String) As T Dim obj As T = Activator.CreateInstance(Of T)() Dim JSONserializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer() obj = JSONserializer.Deserialize(Of T)(json) Return obj End Function End Class </code></pre> <p>Edit: C# :</p> <pre><code>public void ReadRessourceFile() { //Requires Assembly System.Windows.Forms ' System.Resources.ResXResourceReader rsxr = new System.Resources.ResXResourceReader("items.resx"); // Iterate through the resources and display the contents to the console. ' System.Collections.DictionaryEntry d = default(System.Collections.DictionaryEntry); foreach (DictionaryEntry d_loopVariable in rsxr) { d = d_loopVariable; Console.WriteLine(d.Key.ToString() + ":" + ControlChars.Tab + d.Value.ToString()); } //Close the reader. ' rsxr.Close(); } </code></pre> <p>And the JSON helper:</p> <pre><code>public class JSONHelper { public static string Serialize&lt;T&gt;(T obj) { System.Web.Script.Serialization.JavaScriptSerializer JSONserializer = new System.Web.Script.Serialization.JavaScriptSerializer(); return JSONserializer.Serialize(obj); } public static T Deserialize&lt;T&gt;(string json) { T obj = Activator.CreateInstance&lt;T&gt;(); System.Web.Script.Serialization.JavaScriptSerializer JSONserializer = new System.Web.Script.Serialization.JavaScriptSerializer(); obj = JSONserializer.Deserialize&lt;T&gt;(json); return obj; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload