Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.38 KB | None | 0 0
  1. using System;
  2. using System.Drawing;
  3. using System.IO;
  4. using System.Windows.Forms;
  5.  
  6. namespace IDForm
  7. {
  8.     public partial class shitsauce : Form
  9.     {
  10.         public shitsauce()
  11.         {
  12.             InitializeComponent();
  13.         }
  14.  
  15.  
  16.         private void bitch_Click(object sender, EventArgs e)
  17.         {
  18.             string name = "", address = "", phone = "", dob = ""; //path = "C:/" <== got an access denied for this one..the fuck is that bullshit?
  19.             //long dob = 0;
  20.            
  21.  
  22.             name = bawxname.Text;
  23.             address = bawxaddress.Text;
  24.             phone = bawxphone.Text;
  25.             dob = bawxdob.Text;
  26.             //dob = long.Parse(dob.Text); <== Attempted parsing of data types, but that went to horseshit. Im starting to hate me...
  27.  
  28.             SaveFileDialog n = new SaveFileDialog();// I hate you....
  29.  
  30.             FileStream rawr = File.Create("C:/users/chris/desktop/fuckshitup.txt");
  31.  
  32.             //I think because FileStream requires a path overload, it could be conflicting with my SaveFileDialog, but then how do I write the file?
  33.  
  34.             BinaryWriter write = new BinaryWriter(rawr);
  35.             write.Write(name);
  36.             write.Write(address);
  37.             write.Write(phone);
  38.             write.Write(dob);
  39.             rawr.Close(); //<==Originally tried commenting this out for the save file dialog, but no go there...
  40.  
  41.             n.FileName = "Document"; //fucking dialog wont allow me to select a file type...
  42.             n.DefaultExt = ".text"; //Docs said this would allow me to default the extension..they were full of shit
  43.             n.Filter = "Text documents (.txt)|*.txt"; //Again, more bullshit. Didnt do anything
  44.  
  45.             /*
  46.            
  47.              Nullable<bool> horseshit = n.ShowDialog(); <==got a fucking error for the ShowDialog...what the FUCK?!?! The docs had it EXACTLY like this
  48.  
  49.  // Configure save file dialog box
  50.  Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
  51.  dlg.FileName = "Document"; // Default file name
  52.  dlg.DefaultExt = ".text"; // Default file extension
  53.  dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension
  54.  
  55.  // Show save file dialog box
  56.  Nullable<bool> result = dlg.ShowDialog();
  57.  
  58.  // Process save file dialog box results
  59.  if (result == true)
  60.  {
  61.      // Save document
  62.      string filename = dlg.FileName;
  63.  }
  64.  
  65.  
  66.              if (horseshit == true)
  67.              {
  68.                  string
  69.              }
  70.            
  71.      
  72.             StreamWriter fuck = File.CreateText(path); <== access denied error to C:/ and all paths within
  73.             fuck.Write(name);
  74.             fuck.Write(address);
  75.             fuck.Write(phone);
  76.            
  77.             */
  78.  
  79.  
  80.         }
  81.  
  82.         private void textFileToolStripMenuItem_Click(object sender, EventArgs e)
  83.         {
  84.             string name = "", address = "", phone = "", dob = "";
  85.  
  86.             name = bawxname.Text;
  87.             address = bawxaddress.Text;
  88.             phone = bawxphone.Text;
  89.             dob = bawxdob.Text;
  90.  
  91.  
  92.             FileStream rawr = File.Create("C:/users/chris/desktop/fuckshitup.txt");
  93.  
  94.             BinaryWriter write = new BinaryWriter(rawr);
  95.             write.Write(name);
  96.             write.Write(address);
  97.             write.Write(phone);
  98.             write.Write(dob);
  99.             rawr.Close();
  100.         }
  101.  
  102.  
  103.         private void exitProgramToolStripMenuItem_Click(object sender, EventArgs e)
  104.         {
  105.             Application.Exit();
  106.         }
  107.     }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement