Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8.  
  9. namespace WebApplication15
  10. {
  11.     public partial class WebForm1_back : System.Web.UI.Page
  12.     {
  13.         protected void Page_Load(object sender, EventArgs e)
  14.         {
  15.             String hour;
  16.             string teplota, vlhkost, tlak, svetlo, zrazky, vyska;
  17.  
  18.             hour = DateTime.Now.ToString("HH");
  19.             uint n_hour = Convert.ToUInt32(hour);
  20.  
  21.             teplota = Request.QueryString["teplota"];
  22.             vlhkost = Request.QueryString["vlhkost"];
  23.             tlak = Request.QueryString["tlak"];
  24.             svetlo = Request.QueryString["svetlo"];
  25.             vyska = Request.QueryString["vyska"];
  26.             zrazky = Request.QueryString["zrazky"];
  27.  
  28.             using (StreamWriter writer = new StreamWriter("D:\\home\\site\\wwwroot\\TextFile1.txt"))
  29.             {
  30.                 writer.WriteLine(teplota);
  31.                 writer.WriteLine(vlhkost);
  32.                 writer.WriteLine(tlak);
  33.                 writer.WriteLine(svetlo);
  34.                 writer.WriteLine(vyska);
  35.                 writer.WriteLine(zrazky);
  36.             }
  37.  
  38.             if (4 < n_hour + 1 && n_hour + 1 < 10)
  39.             {
  40.                 rezim.Text = "0";
  41.             }
  42.             else if (10 < n_hour + 1 && n_hour + 1 < 20)
  43.             {
  44.                 rezim.Text = "1";
  45.             }
  46.             else
  47.             {
  48.                 rezim.Text = "2";
  49.             }
  50.  
  51.             uint n_zrazky = Convert.ToUInt32(zrazky);
  52.             uint n_teplota = Convert.ToUInt32(teplota);
  53.  
  54.             if (n_zrazky < 1000 && n_teplota <= 0)
  55.             {
  56.                 this.zrazky.Text = "0";
  57.             }
  58.             else if (n_zrazky < 1000 && n_teplota > 1)
  59.             {
  60.                 this.zrazky.Text = "1";
  61.             }
  62.             else
  63.             {
  64.                 this.zrazky.Text = "2";
  65.             }
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement