<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-987251365955667731</id><updated>2012-02-16T21:27:30.593+05:30</updated><title type='text'>Dot Net Tonic</title><subtitle type='html'>Dot Net Stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-796590137325275541</id><published>2009-05-05T14:40:00.004+05:30</published><updated>2009-06-14T19:25:14.108+05:30</updated><title type='text'>How to convert byte array to string in C#</title><content type='html'>public static string ConvertByteArrayToString(byte[] b)&lt;br /&gt;{&lt;br /&gt;string str = string.Empty;&lt;br /&gt;System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();&lt;br /&gt;if (b != null)&lt;br /&gt;{&lt;br /&gt;str = enc.GetString(b);&lt;br /&gt;}&lt;br /&gt;return str;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-796590137325275541?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/796590137325275541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-convert-byte-array-to-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/796590137325275541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/796590137325275541'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-convert-byte-array-to-string.html' title='How to convert byte array to string in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-7492357524648143909</id><published>2009-05-05T14:38:00.002+05:30</published><updated>2009-06-14T19:25:40.745+05:30</updated><title type='text'>How to convert string to byte array in C#</title><content type='html'>public static byte[] ConvertStringToByteArray(string strIN)&lt;br /&gt;{&lt;br /&gt;System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();&lt;br /&gt;return enc.GetBytes(strIN);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-7492357524648143909?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/7492357524648143909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-convert-string-to-byte-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/7492357524648143909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/7492357524648143909'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-convert-string-to-byte-array.html' title='How to convert string to byte array in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-5079857616175937266</id><published>2009-05-02T17:51:00.000+05:30</published><updated>2009-05-02T18:06:51.938+05:30</updated><title type='text'>How to fetch team project names from TFS</title><content type='html'>First thing you need to add references of &lt;span style="color: rgb(255, 0, 0);"&gt;using Microsoft.TeamFoundation.Client;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;using Microsoft.TeamFoundation.WorkItemTracking.Client;&lt;/span&gt; in your project.&lt;br /&gt;&lt;br /&gt;private void GetTeamProjects(string uid,string pwd,string tfServerName)&lt;br /&gt;   {&lt;br /&gt;     NetworkCredential account = new NetworkCredential(uid, pwd);&lt;br /&gt;     TeamFoundationServer teamServer = new TeamFoundationServer(tfServerName, account);&lt;br /&gt;     ArrayList alProjects = new ArrayList();&lt;br /&gt;     if (teamServer.HasAuthenticated)&lt;br /&gt;     {&lt;br /&gt;       WorkItemStore workItemStore = new WorkItemStore(teamServer);&lt;br /&gt;       foreach (Project pr in workItemStore.Projects)&lt;br /&gt;       {&lt;br /&gt;         alProjects.Add(pr.Name);&lt;br /&gt;       }&lt;br /&gt;     }&lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-5079857616175937266?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/5079857616175937266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-fetch-team-project-names-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/5079857616175937266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/5079857616175937266'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-fetch-team-project-names-from.html' title='How to fetch team project names from TFS'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-7079041241874913530</id><published>2009-05-02T16:40:00.000+05:30</published><updated>2009-05-02T16:42:41.619+05:30</updated><title type='text'>How to edit configuration variables in App.config file in C#</title><content type='html'>private void SetAppConfig(string key, string value)&lt;br /&gt;   {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;       Trace.WriteLine("Setting the configuration file...");&lt;br /&gt;       string docName = System.Reflection.Assembly.GetEntryAssembly().Location + ".config";&lt;br /&gt;       XmlDocument doc = new XmlDocument();&lt;br /&gt;       doc.Load(docName);&lt;br /&gt;       XmlNode node = doc.SelectSingleNode("//appSettings");&lt;br /&gt;       XmlElement addElem = (XmlElement)node.SelectSingleNode("//add[@key='" + key + "']");&lt;br /&gt;       if (addElem != null)&lt;br /&gt;       {&lt;br /&gt;         addElem.SetAttribute("value", value);&lt;br /&gt;       }&lt;br /&gt;       XmlTextWriter writer = new XmlTextWriter(docName, null);&lt;br /&gt;       writer.Formatting = Formatting.Indented;&lt;br /&gt;       doc.WriteTo(writer);&lt;br /&gt;       writer.Flush();&lt;br /&gt;       writer.Close();&lt;br /&gt;     }&lt;br /&gt;     catch (Exception ex)&lt;br /&gt;     {&lt;br /&gt;       System.Diagnostics.Trace.WriteLine(ex.Message);&lt;br /&gt;     }&lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-7079041241874913530?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/7079041241874913530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-set-configuration-variables-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/7079041241874913530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/7079041241874913530'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-set-configuration-variables-in.html' title='How to edit configuration variables in App.config file in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-1401324253433993606</id><published>2009-05-02T16:24:00.000+05:30</published><updated>2009-05-02T17:03:52.433+05:30</updated><title type='text'>How to remove all files and directories at inner level from directory in C#</title><content type='html'>private void RemoveFilesAndDirectory(DirectoryInfo targetDir)&lt;br /&gt;    {&lt;br /&gt;      foreach (DirectoryInfo targetSubDir in targetDir.GetDirectories())&lt;br /&gt;      {&lt;br /&gt;        DirectoryInfo di = new DirectoryInfo(targetSubDir.FullName);&lt;br /&gt;        RemoveFilesAndDirectory(di);&lt;br /&gt;      }&lt;br /&gt;      foreach (FileInfo fileName in targetDir.GetFiles())&lt;br /&gt;      {&lt;br /&gt;        File.Delete(fileName.FullName);&lt;br /&gt;      }&lt;br /&gt;      targetDir.Delete();&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-1401324253433993606?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/1401324253433993606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-remove-files-and-directories-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/1401324253433993606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/1401324253433993606'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-remove-files-and-directories-at.html' title='How to remove all files and directories at inner level from directory in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-7089805874853224738</id><published>2009-05-02T16:17:00.000+05:30</published><updated>2009-05-02T17:08:05.585+05:30</updated><title type='text'>How to copy all files and directories at inner level from source to destination directory in C#</title><content type='html'>private void CopyFilesAndDirectories(DirectoryInfo sourceDir, DirectoryInfo targetDir)&lt;br /&gt;    {&lt;br /&gt;      if (!Directory.Exists(targetDir.FullName))&lt;br /&gt;      {&lt;br /&gt;        Directory.CreateDirectory(targetDir.FullName);&lt;br /&gt;      }&lt;br /&gt;      foreach (FileInfo fi in sourceDir.GetFiles())&lt;br /&gt;      {&lt;br /&gt;        fi.CopyTo(Path.Combine(targetDir.ToString(), fi.Name), true);&lt;br /&gt;      }&lt;br /&gt;      foreach (DirectoryInfo sourceSubDir in sourceDir.GetDirectories())&lt;br /&gt;      {&lt;br /&gt;        DirectoryInfo nextTargetSubDir = targetDir.CreateSubdirectory(sourceSubDir.Name);&lt;br /&gt;        CopyFilesAndDirectories(sourceSubDir, nextTargetSubDir);&lt;br /&gt;      }&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-7089805874853224738?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/7089805874853224738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-copy-files-and-directories-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/7089805874853224738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/7089805874853224738'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-copy-files-and-directories-at.html' title='How to copy all files and directories at inner level from source to destination directory in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-3099171753708269010</id><published>2009-05-02T15:05:00.000+05:30</published><updated>2009-05-02T15:17:55.070+05:30</updated><title type='text'>How to fetch System DSN names in C#</title><content type='html'>First thing you have to include namespace &lt;span style="color: rgb(255, 0, 0);"&gt;using Microsoft.Win32;&lt;/span&gt; to deal with Registry.&lt;br /&gt;&lt;br /&gt; private string[] GetSystemDSNNames()&lt;br /&gt;    {     &lt;br /&gt;        RegistryKey reg = null;&lt;br /&gt;        reg = (Registry.LocalMachine).OpenSubKey(@"Software\ODBC\ODBC.INI\ODBC Data Sources");&lt;br /&gt;        if (reg != null)&lt;br /&gt;        {&lt;br /&gt;          return reg.GetValueNames();&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;          return null;&lt;br /&gt;        }&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-3099171753708269010?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/3099171753708269010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-fetch-system-dsn-names-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/3099171753708269010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/3099171753708269010'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-fetch-system-dsn-names-in-c.html' title='How to fetch System DSN names in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-987251365955667731.post-3141774262978577163</id><published>2009-05-01T15:50:00.001+05:30</published><updated>2009-05-01T16:03:02.646+05:30</updated><title type='text'>How to read byte array from file in C#</title><content type='html'>public byte[] ReadArrayBytesFromFile(string fileName)&lt;br /&gt;{&lt;br /&gt;byte[] buffer = null;&lt;br /&gt;FileStream fStrm = new FileStream(fileName, FileMode.Open, FileAccess.Read);&lt;br /&gt;BinaryReader binRead = new BinaryReader(fStrm);&lt;br /&gt;long numBytes = new FileInfo(fileName).Length;&lt;br /&gt;buffer = binRead.ReadBytes((int)numBytes);&lt;br /&gt;return buffer;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/987251365955667731-3141774262978577163?l=dotnettonic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnettonic.blogspot.com/feeds/3141774262978577163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-read-byte-array-from-file_01.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/3141774262978577163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/987251365955667731/posts/default/3141774262978577163'/><link rel='alternate' type='text/html' href='http://dotnettonic.blogspot.com/2009/05/how-to-read-byte-array-from-file_01.html' title='How to read byte array from file in C#'/><author><name>Kiran Saravade</name><uri>http://www.blogger.com/profile/02101897453041604967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/_6onnSUVwmjk/S8yG8j7FovI/AAAAAAAAADM/DQC2XARTJDQ/S220/MI_logo.png'/></author><thr:total>0</thr:total></entry></feed>
