<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>نوشته های نیوشا حمیدی</title><link>https://virgool.ir/feed/@m_37697958</link><description></description><language>fa</language><pubDate>2026-11-11 05:44:19</pubDate><image><url>https://files.virgool.ir/upload/users/4079941/avatar/LeI6QY.jpg</url><title>نیوشا حمیدی</title><link>https://virgool.ir/@m_37697958</link></image><item><title>Share my programing experience in c#, C++</title><link>https://virgool.ir/@m_37697958/share-my-programing-experience-in-c-c-jopjbhmkj9eb</link><description>when do I need Thread? whats that?...با دروددر این بلاگ تجربه ای راجب اینکه آیا در برنامه ام نیازی به ترد دارم یا نه را به اشتراک گذاشته ام:در ادامه کد مربوط به الگوریتم رمز گذاری سزار را با زبان c# می نویسم. در این برنامه ابتدا متن را از فایلی خوانده و الگوریتم را بر روی آن با تعداد شیفت 3 می نویسم.&lt;pre&gt;&lt;code class=&#34;language-csharp&#34;&gt;&#xA;namespace CaesarCiper&#xA;{&#xA;    public partial class Form1 : Form&#xA;    {&#xA;        String line;&#xA;        StringBuilder stb, stbS;&#xA;        string[] lineWords;&#xA;        public Form1()&#xA;        {&#xA;            InitializeComponent();&#xA;        }&#xA;        private void btnStart_Click(object sender, EventArgs e)&#xA;        {&#xA;            ReadFileToStringBuilder();&#xA;            doCaesarCiper();&#xA;        }&#xA;        private void ReadFileToStringBuilder()&#xA;        {&#xA;            try&#xA;            {&#xA;                //Pass the file path and file name to the StreamReader constructor&#xA;                StreamReader sr = new StreamReader(&#34;D:\\project\\testCaesar\\ceasar.txt&#34;);&#xA;                //Read the first line of text&#xA;                stb = new StringBuilder(sr.ReadToEnd());&#xA;                sr.Close();&#xA;&#xA;                txtFile.Text = stb.ToString(); &#xA;            }&#xA;            catch (Exception e)&#xA;            {&#xA;                txtMsg.Text = &#34;Exception: &#34; + e.Message;&#xA;            }&#xA;            finally&#xA;            {&#xA;                txtMsg.Text += &#34;finally: \n&#34;;&#xA;            }&#xA;&#xA;        }&#xA;        private void doCaesarCiper()&#xA;        {&#xA;            stbS = new StringBuilder();&#xA;            int nShift = 3;&#xA;            int i = 0;&#xA;            Char ch;&#xA;            while (i &lt; stb.Length)&#xA;            {&#xA;                ch = stb[i];&#xA;                if (Char.IsLetter(stb[i]))&#xA;                {&#xA;                    if (Char.IsUpper(stb[i]))&#xA;                    {&#xA;                        ch = (Char)(((int)stb[i] + nShift - 65) % 26 + 65);&#xA;                    }&#xA;                    else if (Char.IsLetter(stb[i]) &amp;&amp; Char.IsLower(stb[i]))&#xA;                    {&#xA;                        ch = (Char)(((int)stb[i] + nShift - 97) % 26 + 97);&#xA;                    }&#xA;                   &#xA;                }&#xA;                i++;&#xA;&#xA;                stbS.Append(ch);&#xA;            }&#xA;            txtsecured.Text = stbS.ToString();&#xA;            txtMsg.Text += &#34;doCaesarCiper:\n &#34;;&#xA;            Thread.Sleep(2000);&#xA;        }&#xA;        private void ReadFile()&#xA;        {&#xA;            try&#xA;            {&#xA;                //Pass the file path and file name to the StreamReader constructor&#xA;                StreamReader sr = new StreamReader(&#34;D:\\project\\testCaesar\\ceasar.txt&#34;);&#xA;                //Read the first line of text&#xA;                line = sr.ReadLine();&#xA;                //Continue to read until you reach end of file&#xA;                while (line != null)&#xA;                {&#xA;                    //write the line to console window&#xA;                    txtFile.Text += line;&#xA;                    //Read the next line&#xA;                    line = sr.ReadLine();&#xA;                    // lineWords = line.Split(&#39; &#39;);&#xA;                }&#xA;                //close the file&#xA;                sr.Close();&#xA;                Console.ReadLine();&#xA;                txtMsg.Text += &#34;Read Finished \n&#34;;&#xA;            }&#xA;            catch (Exception e)&#xA;            {&#xA;                txtMsg.Text = &#34;Exception: &#34; + e.Message;&#xA;            }&#xA;            finally&#xA;            {&#xA;                txtMsg.Text += &#34;finally: \n&#34;;&#xA;            }&#xA;            Thread.Sleep(2000);&#xA;        }&#xA;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description><category>نیوشا حمیدی</category><author>نیوشا حمیدی</author><pubDate>Sat, 21 Jun 2025 13:07:37 +0330</pubDate></item></channel></rss>