File tree 4 files changed +42
-0
lines changed
4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1
1
/c /obj /
2
2
/c /* .exe
3
+ /cs /* .exe
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ call " %VS100COMNTOOLS% vsvars32.bat"
3
+ csc cat.cs
Original file line number Diff line number Diff line change
1
+ .\cat.exe < ..\Test.json
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . IO ;
4
+ using System . Web . Script . Serialization ;
5
+
6
+ namespace Cat
7
+ {
8
+ class Program
9
+ {
10
+ static void Main ( string [ ] args )
11
+ {
12
+ StreamReader sr = new StreamReader ( Console . OpenStandardInput ( ) ) ;
13
+ string input = sr . ReadToEnd ( ) ;
14
+ sr . Dispose ( ) ;
15
+
16
+ JavaScriptSerializer ser = new JavaScriptSerializer ( ) ;
17
+ dynamic json = ser . DeserializeObject ( input ) ;
18
+ for ( int i = 1 ; i < json . Length ; i ++ )
19
+ {
20
+ dynamic block = json [ i ] ;
21
+ string blockType = block [ 0 ] ;
22
+ Dictionary < string , object > blockAttr = block [ 1 ] ;
23
+
24
+ for ( int j = 2 ; j < block . Length ; j ++ )
25
+ {
26
+ dynamic span = block [ j ] ;
27
+ string spanType = span [ 0 ] ;
28
+ string text = span [ 1 ] ;
29
+ Console . Write ( text ) ;
30
+ }
31
+
32
+ Console . WriteLine ( ) ;
33
+ Console . WriteLine ( ) ;
34
+ }
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments