static async Task Main(string[] args) { //Get data from API string getReponse = await HTTP.Get("https://webapibasicsstudenttracker.azurewebsites.net/api/Students", ""); //Console.WriteLine(getReponse); //Word HttpApp.Models.Utilities.CreateWord.CreateWordprocessingDocument(@"d:\00.Bigdata\DataEncoding\info.docx"); string document = @"d:\00.Bigdata\DataEncoding\info.docx"; string fileName = @"d:\00.Bigdata\DataEncoding\myimage.jpg"; HttpApp.Models.Utilities.CreateWord.InsertAPicture(document, fileName); HttpApp.Models.Utilities.CreateWord.OpenAndAddTextToWordDocument(document, getReponse); //Excel HttpApp.Models.Utilities.CreateExcel.CreateSpreadsheetWorkbook(@"D:\00.Bigdata\DataEncoding\info.xlsx"); HttpApp.Models.Utilities.CreateExcel.InsertText(@"D:\00.Bigdata\DataEncoding\info.xlsx", "Hello, my name is Jiyoung"); HttpApp.Models.Utilities.CreateExcel.InsertText(@"D:\00.Bigdata\DataEncoding\info.xlsx", "Hello, my name is Jiyoung"); //Presentation string filepath = @"d:\00.Bigdata\DataEncoding\info.pptx"; HttpApp.Models.Utilities.CreatePre.CreatePresentation(filepath); //HttpApp.Models.Utilities.CreatePre.InsertNewSlide(@"d:\00.Bigdata\DataEncoding\info.pptx", 1, "My new slide"); //FPT List <string> directories = FTP.GetDirectory(Constants.FTP.BaseUrl); string localUploadFilePath = @"d:\00.Bigdata\DataEncoding\info.docx"; string remoteUploadFileDestination = "/StudentId FirstName LastName/info.docx"; Console.WriteLine(FTP.UploadFile(localUploadFilePath, Constants.FTP.BaseUrl + remoteUploadFileDestination)); }
public void requestData() { HTTP.Get("/match-award", new Dictionary <string, object> { { "match_id", GameData.Shared.MatchID }, }, (data) => { StartCoroutine(SetData(data)); }); }
private void AskPartnersData() { HTTP.Get("/check-partner", new Dictionary <string, object>() { { "a_uid", aimUid[0] }, { "b_uid", aimUid[1] }, { "room_id", GameData.Shared.Room.Value }, }, (data) => { var partnerData = PoolMan.Spawn("PartnerData"); partnerData.GetComponent <DOPopup>().Show(); var dataDic = Json.Decode(data) as Dictionary <string, object>; partnerData.GetComponent <PartnerData>().Init(dataDic); }); }
public void Init() { //标题信息 MatchName.text = GameData.Shared.RoomName.Value; PlayerNum.text = "-/-"; //p1信息 var joinFee = GameData.MatchData.JoinFee; EntryFee.text = joinFee + "+" + joinFee / 10; LvUpTime.text = GameData.MatchData.Time + "分钟"; InitalScore.text = GameData.MatchData.BankrollNum.ToString(); HTTP.Get("/match/" + GameData.Shared.MatchID, new Dictionary <string, object> { { "roomid", GameData.Shared.Room.Value }, }, (data) => { var roomsData = Json.Decode(data) as Dictionary <string, object>; PlayerNum.text = roomsData.Int("valid_gamers") + "/" + roomsData.Int("ready_gamers"); //底部相关 ButtomText.text = roomsData.Int("blind_lv") <= roomsData.Int("limit_level")? "延时报名至第" + roomsData.Int("limit_level") + "级别" : "已截止报名"; timer = roomsData.Int("spent"); setTimeText(); //p1信息 TableNum.text = roomsData.Int("table_num") == 0 ? "决赛桌" : roomsData.Int("table_num").ToString(); RoomPlayerNum.text = roomsData.Int("max_seats").ToString(); RoomNum.text = roomsData.Int("table_count").ToString(); Rebuy.text = roomsData.Int("rebuy_count").ToString(); AddOn.text = roomsData.Int("add_on").ToString(); CreatorName.text = roomsData.String("creator_name"); BlindLv.text = roomsData.Int("blind_lv").ToString(); LimitLevel.text = roomsData.Int("limit_level").ToString(); _.SetMsgText(roomsData.Int("half_break") == 1, HalfBreak); _.SetMsgText(roomsData.Int("gps_limit") == 1, GPSLimit); _.SetMsgText(roomsData.Int("ip_limit") == 1, IPLimit); }); Toggles[0].isOn = true; }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (loadtimes == 0) { HTTP.Get(ServicePath.GalleryAshx, new Action <string>((str) => { ObservableCollection <GalleryModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject <ObservableCollection <GalleryModel> >(str); Dispatcher.Invoke(new Action(() => { foreach (var item in list) { HTTP.DownImage(item.Name, item.Image, new Action <string>((path) => { item.Image = path; })); item.Image = ""; ShowList.Add(item); } })); }), new Action <Exception>((ex) => { })); } loadtimes++; }
public void Initialize() { #if (UNITY_5 && !UNITY_5_0) titleContent.text = "Forge Editor"; #else title = "Forge Editor"; #endif minSize = new Vector2(400, 400); //ForgeIcon = Resources.Load<Texture2D>("BMSLogo"); //ScrollPos = Vector2.zero; regularWhite.fontSize = 14; regularWhite.wordWrap = true; if (UnityEditorInternal.InternalEditorUtility.HasPro()) { regularWhite.normal.textColor = Color.white; boldWhite.normal.textColor = Color.white; } boldWhite.fontSize = 14; boldWhite.wordWrap = true; boldWhite.fontStyle = FontStyle.Bold; News.Add(new ForgeEditorDisplayObject("Loading news...", ForgeEditorDisplayObject.DisplayType.Paragraph, boldWhite, regularWhite)); Videos.Add(new ForgeEditorDisplayObject("Loading videos...", ForgeEditorDisplayObject.DisplayType.Paragraph, boldWhite, regularWhite)); //Videos.Add(new ForgeEditorDisplayObject("Under Construction!", ForgeEditorDisplayObject.DisplayType.Header, boldWhite, regularWhite)); //Store.Add(new ForgeEditorDisplayObject("Loading store...", ForgeEditorDisplayObject.DisplayType.Paragraph, boldWhite, regularWhite)); Documentation.Add(new ForgeEditorDisplayObject("Coming soon!", ForgeEditorDisplayObject.DisplayType.Header, boldWhite, regularWhite)); //About.Add(new ForgeEditorDisplayObject("Bearded Man Studios, Inc.", ForgeEditorDisplayObject.DisplayType.Header, boldWhite, regularWhite)); //About.Add(new ForgeEditorDisplayObject("Brent Farris, Brett Faulds", ForgeEditorDisplayObject.DisplayType.Paragraph, boldWhite, regularWhite)); HTTP newsHttp = new HTTP(NEWS_ENDPOINT); newsHttp.Get(LayoutNews); HTTP videosHttp = new HTTP(VIDEOS_ENDPOINT); videosHttp.Get(LayoutVideos); //HTTP storeHttp = new HTTP(STORE_ENDPOINT); //storeHttp.Get(LayoutStore); }
private static void CheckForUpdates() { HTTP http = new HTTP("http://developers.forgepowered.com/Model/Info"); http.Get((obj) => { SimpleJSON.JSONNode data = SimpleJSON.JSONNode.Parse((string)obj); if (data["version"] == null) { Debug.LogWarning("Could not connect to server to check version"); return; } if (CURRENT_VERSION < data["version"].AsFloat) { Debug.Log("WOOT! There is a new version available! :D\nGo to http://developers.forgepowered.com/Profile to download now!"); } else { Debug.Log("You already have the latest version of Forge Networking"); } }); }
public void Init(string uid) { hasChacked = false; EnterBtn.interactable = false; aimUid = new List <string>(); HTTP.Get("/post-fee", new Dictionary <string, object>() { }, (data) => { var feedata = Json.Decode(data) as Dictionary <string, object>; checkFee = feedata.Int("checkFee"); Text_CheckFee.text = checkFee.ToString(); }); ToggleList.Clear(); var list = GameData.Shared.Players; float num = 738 + Mathf.Ceil(list.Count / 3f) * 269 - 40; GetComponent <RectTransform>().sizeDelta = new Vector2(GetComponent <RectTransform>().sizeDelta.x, num); foreach (var item in list) { var player = item.Value; if (player.Uid == GameData.Shared.Uid) { continue; } var go = Instantiate(ListChildPre, ToggleList); go.GetComponentInChildren <Text>().text = player.Name; go.GetComponentInChildren <Avatar>().SetImage(player.Avatar); go.GetComponent <Toggle>().onValueChanged.AddListener((bool isOn) => { if (isOn) { if (aimUid.Count == 2) { go.GetComponent <Toggle>().isOn = false; } else { aimUid.Add(player.Uid); if (aimUid.Count == 2) { HTTP.Get("/has-checked", new Dictionary <string, object>() { { "a_uid", aimUid[0] }, { "b_uid", aimUid[1] }, { "room_id", GameData.Shared.Room.Value }, }, (data) => { var dataDic = Json.Decode(data) as Dictionary <string, object>; hasChacked = dataDic.Int("has") == 1; EnterBtn.transform.GetChild(1).gameObject.SetActive(!hasChacked); EnterBtn.interactable = true; }); } } } else { aimUid.Remove(player.Uid); if (aimUid.Count != 2) { EnterBtn.interactable = false; } } }); if (player.Uid == uid) { go.GetComponent <Toggle>().isOn = true; } } }
public void GetTest() { var res = HTTP.Get("http://httpbin.org/status/200"); Assert.Equal(HttpStatusCode.OK, res.StatusCode); }
public static void FetchRanking(Action <JsonModel.Record[]> onSuccess, Action <WWW> onError = null) { HTTP.Get(hostName + "home/ranking.json", www => { onSuccess(JsonMapper.ToObject <JsonModel.Record[]>(www.text)); }, onError); }
public static void CreatePlayerId(Action <JsonModel.PlayerInfo> onSuccess, Action <WWW> onError = null) { HTTP.Get(hostName + "home/create_player_id.json", www => { onSuccess(JsonMapper.ToObject <JsonModel.PlayerInfo>(www.text)); }, onError); }