-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
57 lines (52 loc) · 1.4 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Net;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
namespace BMY
{
public static class ListUtils
{
public static T ReversedIndex<T> (this List<T> self, int index)
{
return self [self.Count - index - 1];
}
}
class MainClass
{
public static void Main (string[] args)
{
List<int> numbers = new List<int>{1,2,3};
var filtered = from int n in numbers
where n % 2 == 1
select n;
foreach (int n in filtered) {
Console.WriteLine (n);
}
BMYClient cli = new BMYClient ("Guest", "");
var uri = cli.login ();
var page = cli.getMain (uri);
Console.WriteLine ("Main Page");
Console.WriteLine (page);
page = cli.getNav (page);
Console.WriteLine ("Nav Page");
Console.WriteLine (page);
var sec = "电脑应用";
var blist = cli.getBoardList (sec);
BBSBoard board = blist [3];
foreach (var p in blist) {
Console.WriteLine ("{0},{1}", p.boardID, p.boardName);
}
board.topics.Refresh (cli);
Console.WriteLine (board.topics);
var top = board.topics.topicList.ReversedIndex (0);
top.Refresh (cli);
top.articleList.ReversedIndex (0) .reply (cli, "Test Mono C# libbmy Article Reply");
//board.post (cli, "Test From Mono C#", "Just Test");
// filtered.ForEach(Console.WriteLine);
Console.WriteLine ("Hello World!");
}
}
}