public static string Post( string url, byte[] content, string proxy = "", ICookieContainer cookieContainer = null, ResponceType respType = ResponceType.BodyOnly, string userAgent = "", string contentPostingType = "application/x-www-form-urlencoded", string encoding = "UTF-8", string[] additionalHeaders = null, bool useRedirect = true, int maxRedirectCount = 5, int timeout = 30000, string downloadPath = null, bool useOriginalUrl = false, bool throwExceptionOnError = true) { return(ZennoPoster.HTTP.Request( method: HttpMethod.POST, url: url, content: content, contentPostingType: contentPostingType, proxy: proxy, Encoding: encoding, respType: respType, Timeout: timeout, UserAgent: userAgent, UseRedirect: useRedirect, MaxRedirectCount: maxRedirectCount, AdditionalHeaders: additionalHeaders, DownloadPath: downloadPath, UseOriginalUrl: useOriginalUrl, throwExceptionOnError: throwExceptionOnError, cookieContainer: cookieContainer)); }
private bool IsValid(ResponceType responceType) { if (qs[currentQuest].ValidResponce != responceType) { MessageBox.Show("Вы проиграли!"); _view.Close(); return(false); } else { if (moneyLvl[currentQuest] == 1000000) { MessageBox.Show("Поздравляем!!!!!! Вы выйграли миллион!! Теперь вы миллионер!!!"); _view.Close(); } else { MessageBox.Show("Это правильный ответ! Поздравляю, вы выйграли " + moneyLvl[currentQuest] + " денег!"); if (moneyLvl[currentQuest] == 2000) { StonePrice = 2000; MessageBox.Show("Вы достигли первой несгораемой суммы - " + StonePrice.ToString()); } if (moneyLvl[currentQuest] == 50000) { StonePrice = 50000; MessageBox.Show("Вы достигли второй несгораемой суммы - " + StonePrice.ToString()); } currentQuest++; _view.SetQuest(qs[currentQuest]); if (!_view.A.IsEnabled) { _view.A.IsEnabled = true; } if (!_view.B.IsEnabled) { _view.B.IsEnabled = true; } if (!_view.C.IsEnabled) { _view.C.IsEnabled = true; } if (!_view.D.IsEnabled) { _view.D.IsEnabled = true; } } return(true); } }
public void Fifty_Click(object sender, RoutedEventArgs e) { (sender as Button).IsEnabled = false; Random rand = new Random(); ResponceType rnd = (ResponceType)rand.Next(0, 4); while (rnd == qs[currentQuest].ValidResponce) { rnd = (ResponceType)rand.Next(0, 4); } _view.A.IsEnabled = false; _view.B.IsEnabled = false; _view.C.IsEnabled = false; _view.D.IsEnabled = false; DisableAllButtonNot(qs[currentQuest].ValidResponce); DisableAllButtonNot(rnd); }
public Client(string id, string ip, int port, ResponceType responceType) { _userHandle = GCHandle.Alloc(_userDataDummy, GCHandleType.Pinned); _userData = _userHandle.AddrOfPinnedObject(); _clientId = CreateClient(id, ip, port, _userData); _сallbackConnectedInstance = onConnect; _callbackDisconnectedInstance = onDisconnect; _callbackMessageInstance = onMessage; _callbackBitmapInstance = onBitmap; _callbackFrameInstance = onFrame; RegisterConnectedHandler(_clientId, _сallbackConnectedInstance); RegisterDisconnectedHandler(_clientId, _callbackDisconnectedInstance); RegisterMessageHandler(_clientId, responceType, _callbackMessageInstance); RegisterBitmapHandler(_clientId, _callbackBitmapInstance); RegisterFrameHandler(_clientId, _callbackFrameInstance); }
public void CallFriend_Click(object sender, RoutedEventArgs e) { (sender as Button).IsEnabled = false; Random rand = new Random(); int result = rand.Next(0, 100); if (result < 80) { MessageBox.Show("Я думаю, что правильный ответ - " + qs[currentQuest].ValidResponce.ToString(), "Ответ Коляна" + result.ToString()); } else { ResponceType rnd = (ResponceType)rand.Next(0, 4); while (rnd == qs[currentQuest].ValidResponce) { rnd = (ResponceType)rand.Next(0, 4); } MessageBox.Show("Я думаю, что правильный ответ - " + rnd.ToString(), "Ответ Коляна" + result.ToString()); } }
void DisableAllButtonNot(ResponceType type) { switch (type) { case ResponceType.A: _view.A.IsEnabled = true; break; case ResponceType.B: _view.B.IsEnabled = true; break; case ResponceType.C: _view.C.IsEnabled = true; break; case ResponceType.D: _view.D.IsEnabled = true; break; default: break; } }
public static extern int RegisterMessageHandler(uint objectPtr, ResponceType type, CallbackMessage callback);