daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Aug 11th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Two Setups For Same Project (visual studio 2008 , c#)
  2. public void GetSettings()
  3.     {
  4.         string fileName = "./Names.xml";
  5.  
  6.         if (File.Exists(fileName))
  7.         {
  8.             XmlTextReader xml = new XmlTextReader(fileName);
  9.  
  10.             while (xml.Read())
  11.             {
  12.                 if (xml.Name.Equals("pgsql"))
  13.                 {
  14.                     try
  15.                     {
  16.                         button2.Text = xml.GetAttribute("button2");
  17.                         button3.Text = xml.GetAttribute("button3");
  18.                         button4.Text = xml.GetAttribute("button4");
  19.                         button5.Text = xml.GetAttribute("button5");
  20.                     }
  21.                     catch (Exception)
  22.                     {
  23.                         throw new Exception("Settings: Failed to get all settings");
  24.                     }
  25.                 }
  26.             }
  27.         }
  28.         else
  29.         {
  30.             throw new Exception("Settings: pgsql.xml not found!");
  31.         }
  32.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top