小笔记

            string fullPathname = openFileDialog.FileName;
            FileInfo src = new FileInfo(fullPathname);
            fileName.Text = src.Name;
            source.Clear();

            using (TextReader reader = new StreamReader(fullPathname))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    source.Text += line + "\n";
                }
            }

 

        public static void RefValue(ref int param)
        {
            param = 42;
        }

        public static void OutValue(out int param)
        {
            param = 43;
        }

            int i = 0;
            Pass.RefValue(ref i);
            Console.WriteLine(i);//42

            int j = 0; 
            Pass.OutValue(out j);
            Console.WriteLine(j);//43

 

posted @ 2013-03-24 07:06  擅士典内  阅读(120)  评论(0编辑  收藏  举报