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.Threading.Tasks;
- using System.ServiceModel;
- namespace WcfService2
- {
- public class Service1Client : ClientBase<IService1>, IService1
- {
- public List<wpis> json(string id)
- {
- return base.Channel.json(id);
- }
- public void Save(wpis node)
- {
- base.Channel.Save(node);
- }
- class Program
- {
- public wpis arrange(string str)
- {
- wpis temp = null;
- temp.message = str;
- if (temp.message.Contains("#poll"))
- temp.Category = "#poll";
- else
- if (temp.message.Contains("#warn"))
- temp.Category = "#warn";
- else
- if (temp.message.Contains("#update"))
- temp.Category = "#update";
- if (temp.message.Contains("@john"))
- temp.Person = "@john";
- else
- if (temp.message.Contains("@all"))
- temp.Person = "@all";
- else
- if (temp.message.Contains("@all-friends"))
- temp.Person = "@all-friends";
- return temp;
- }
- void Main(string[] args)
- {
- Service1Client client = new Service1Client();
- string[] log = new string[10];
- log[0] = "I have won #update @all ";
- log[1] = "I like trains #poll @john ";
- log[2] = "I am sleepy #warn @all-friends ";
- log[3] = "We are hungry #update @allfriends ";
- log[4] = "I hate testing apps #poll @john ";
- log[5] = "Just a sample stream #poll @all ";
- log[6] = "Dont wanna go back #warn @all-friends";
- log[7] = "I dont play #update @john";
- log[8] = "Very sleepy #warn @all-friends ";
- log[9] = "My name is not John #poll @john ";
- for (int i = 0; i < 10; i++)
- {
- wpis temp = arrange(log[i]);
- Save(arrange(log[i]));
- }
- }
- }
- } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement