public profile() { InitializeComponent(); string User_ID = setuser.getUser_id(); string userIntro = ""; int numFollowing = 0; int numFollower = 0; pro_ID.Text = User_ID.ToString(); Func <Task> runAsync = async() => { try { userIntro = await client.GetPersonalDescription(User_ID).ConfigureAwait(false); numFollowing = await client.GetFollowingCounts(User_ID).ConfigureAwait(false); numFollower = await client.GetFollowerCounts(User_ID).ConfigureAwait(false); } catch (Exception q) { Console.WriteLine(q.Message); } }; runAsync().GetAwaiter().GetResult(); pro_Name.Text = userIntro.ToString(); pro_follower.Text = numFollower.ToString(); pro_following.Text = numFollowing.ToString(); }
static void test() { MustagramClient client = MustagramClient.GetClient(); // RunAsync().GetAwaiter().GetResult(); Func <Task> runAsync = async() => { try { if (await client.SendLoginInfo("유동관", "1111")) { System.Console.WriteLine("true"); } else { System.Console.WriteLine("false"); } String result = await client.GetPersonalDescription("유동관"); int like = await client.GetPostLike(1); System.Console.WriteLine(result); System.Console.WriteLine(like); if (await client.CreatePost("lsc", "init")) { System.Console.WriteLine("성공"); } else { System.Console.WriteLine("실패"); } // PostList postList = ; } catch (Exception e) { System.Console.WriteLine(e.Message); } }; runAsync().GetAwaiter().GetResult(); }