Saving json file in text file

I have a link like translate.google.com/translate_a/t?client=t&text=like&hl=en&sl=en&tl=bn&ie=UTF-8&oe=UTF-8&multires=1&otf=2&ssel=4&tsel=0&otf=1&ssel=4&tsel=0&sc=1 .

Here in text=like it will change as text=book text=pen , which means that it will be my input word, and I will loop it 1000 times.

I am making a dictionary. The above url outputs JSON data.

I want to skip 1000 words and get their json output in a single text file - how can I do this in C #?

+4
source share
2 answers

see this example maybe usfull

 Person person = GetPerson(); using (FileStream fs = File.Open(@"c:\person.json", FileMode.CreateNew)) using (StreamWriter sw = new StreamWriter(fs)) using (JsonWriter jw = new JsonTextWriter(sw)) { jw.Formatting = Formatting.Indented; JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(jw, person); } 
+3
source

You want to request JSON data and parse it with C # JSON.

This question contains extensive information on how to parse JSON.

You can download JSON by requesting this page using WebClient ToString . Then you can pass this to the JSON parser.

Depending on what you want to do with the data (you do not quite understand this), you can use a JSON object to manage it.

Alternatively , if you just want to upload data to a file , you can use the WebClient DownloadFile .

+1
source

All Articles