Page 43 - ePB316_最佳案例 Visual Basic 2017 程式設計
P. 43

Chapter 03 │基本輸出入




                    ɚeWriteLine ˙ج

                        WriteLine ˙جٙԴ͜˙όѩΝ Write ˙جd̥݊༟ࣘ፩̈ʘܝу༪ɓΐfԷνj

                        Console.WriteLine("a")

                        Console.WriteLine("aa")

                    ഐ؈݊

                        a
                        aa


                    Ͼ

                        Console.Write("a")
                        Console.Write("aa")

                    ഐ؈݊

                        aaa


                    ɧeRead ˙ج

                        Ϥ˙جٙႧجމ

                        Public Shared Function Read() As Short

                    ˸ɨાࠑ̙ᛘ՟ఊɓοʩdԨΪՉ ASCII CodefԷνjᒟɝ adۆΪ 97iШ߰

                    ᒟɝ abcd͵̥Ϊ 97f

                        Dim a As Short
                        a = Console.Read( )
                        Console.WriteLine(a)


                    ߰ࠅ፩̈הᒟɝٙοʩdۆࠅԴ͜ᔷۨfԷνj˸ɨાࠑ̙ਗ਼הᒟɝٙοʩd˸ο
                    ʩٙҖό፩̈fνᒟɝ ad̙፩̈ af

                        Dim a As Short
                        Dim b As Char
                        a = Console.Read( )
                        b = Chr(a)         'Chr ݊ᔷۨՌόdᔷމοʩ

                        Console.WriteLine(b)


                                                                                                            35
   38   39   40   41   42   43   44   45   46   47   48