Advertisement
Guest User

bah dot net

a guest
Nov 6th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 KB | None | 0 0
  1. <target name="readjson">
  2.  
  3.  
  4.         <script language="C#" >
  5.           <references>
  6.              <include name="System.Web.Extensions.dll" /> <!-- .Net 3.5 -->
  7.           </references>
  8.           <imports>
  9.               <import namespace="System.Web.Script.Serialization" /> <!-- Needed for JavaScriptSerializer -->
  10.               <import namespace="System.Collections.Generic" />      <!-- Needed for List -->
  11.           </imports>
  12.           <code>
  13.             <![CDATA[
  14.  
  15.             public class Registry
  16.             {
  17.                 public string Component { get; set; }
  18.                 public List<ComponentDetail> ComponentDetails { get; set; }
  19.             }
  20.  
  21.             public class ComponentDetail
  22.             {
  23.                 public string Name { get; set; }
  24.                 public string Website { get; set; }
  25.                 public string Version { get; set; }
  26.                 public LatestVersion LatestVersion { get; set; }
  27.             }
  28.  
  29.             public class LatestVersion
  30.             {
  31.                 public string Version { get; set; }
  32.                 public string URL { get; set; }
  33.             }
  34.  
  35.             public static void readJson(Project project) {
  36.                 string json = File.ReadAllText(Environment.CurrentDirectory + @"\wpnxm-software-registry.json");
  37.  
  38.                 JavaScriptSerializer serializer = new JavaScriptSerializer();
  39.                 serializer.Deserialize<JsonData>>(json);
  40.  
  41.             }
  42.  
  43.             ]]>
  44.           </code>
  45.         </script>
  46.  
  47.     </target>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement