Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Net;
- namespace ConsoleApplication1
- //This code just my friend's homework.
- //Question Description:
- //Process the data form web, filter the telephone number if begins with "06", show it telephone number,store name and address.
- //"06" is south of Taiwan local telephone phone code.
- class Program
- {
- static void Main(string[] args)
- {
- //Hey, Data here.
- string url="https://docs.google.com/uc?export=download&id=0B0eazGf8c9cJOV81Z2tqbml1aGM";
- WebClient web=new WebClient();
- string str = web.DownloadString(url);
- string[] strAry = str.Split('\n');
- for (int i = 0; i < strAry.Length; i++) {
- string[] line = strAry[i].Split(';');
- if (line[1].Substring(0,2)=="06"){
- Console.WriteLine(line[1] + "," + line[0] + "," + line[3]);
- }
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement