title: Connect to Sharepoint site using specific username/Password through WinForm App
body: <p>Hay,
  I'm working on a windows form application (C#) that connects to a sharepoint site and read data from it (lists),</p>
  
  <p><strong>the question is:</strong>
  how can I connect to the site using specific username/Password, and not using the current windowsUser or domain user.</p>
  
  <p>Please advice</p>
  
  <p><strong>Edit</strong>: P.S.: working on SP 2007</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code> SPSecurity.RunWithElevatedPrivileges(delegate()
          {
              using (SPSite sourceSite = new SPSite(txtBoxSP.Text))
              {
                  SPWeb sourceWeb = sourceSite.RootWeb;
                  SPUserCollection usrs = sourceWeb.AllUsers;
  
                  SPListCollection col = sourceWeb.GetListsOfType(SPBaseType.GenericList);
  
                  foreach (SPList list in col)
                      System.Diagnostics.Debug.WriteLine(string.Format("My Name: {0}, Type: {1}, Length: {2}",
                          list.Title, list.GetType().ToString(), list.ItemCount.ToString()));
              }
          });
  </code></pre>