审判者
究竟怎样的人生才能让人喜欢上命运这个词
- 精华
- 5
- 帖子
- 11208
- 威望
- 10 点
- 积分
- 12714 点
- 种子
- 8 点
- 注册时间
- 2005-2-14
- 最后登录
- 2024-11-22
|
发表于 2012-4-21 00:27 · 湖北
|
显示全部楼层
baliwan 发表于 2012-4-20 21:58
其实我看了半天API,完全没发现有IO相关的class和function.........
- namespace System
- {
- public static class Console
- {
- internal static TextWriter stdout;
- private static TextWriter stderr;
- private static TextReader stdin;
- public static TextWriter Error
- {
- get
- {
- return Console.stderr;
- }
- }
- public static TextWriter Out
- {
- get
- {
- return Console.stdout;
- }
- }
- public static TextReader In
- {
- get
- {
- return Console.stdin;
- }
- }
- private static void SetupStreams (Encoding inputEncoding, Encoding outputEncoding)
- {
- Console.stderr = new UnexceptionalStreamWriter (Console.OpenStandardError (0), outputEncoding);
- ((StreamWriter)Console.stderr).AutoFlush = true;
- Console.stderr = TextWriter.Synchronized (Console.stderr, true);
- Console.stdout = new UnexceptionalStreamWriter (Console.OpenStandardOutput (0), outputEncoding);
- ((StreamWriter)Console.stdout).AutoFlush = true;
- Console.stdout = TextWriter.Synchronized (Console.stdout, true);
- Console.stdin = new UnexceptionalStreamReader (Console.OpenStandardInput (0), inputEncoding);
- Console.stdin = TextReader.Synchronized (Console.stdin);
- GC.SuppressFinalize (Console.stdout);
- GC.SuppressFinalize (Console.stderr);
- GC.SuppressFinalize (Console.stdin);
- }
- private static Stream Open (IntPtr handle, FileAccess access, int bufferSize)
- {
- Stream result;
- try
- {
- result = new FileStream (handle, access, false, bufferSize, false, bufferSize == 0);
- }
- catch (IOException)
- {
- result = new NullStream ();
- }
- return result;
- }
- public static Stream OpenStandardError ()
- {
- return Console.OpenStandardError (0);
- }
- [SecuritySafeCritical ]
- public static Stream OpenStandardError (int bufferSize)
- {
- return Console.Open (MonoIO.ConsoleError, FileAccess.Write, bufferSize);
- }
- public static Stream OpenStandardInput ()
- {
- return Console.OpenStandardInput (0);
- }
- [SecuritySafeCritical ]
- public static Stream OpenStandardInput (int bufferSize)
- {
- return Console.Open (MonoIO.ConsoleInput, FileAccess.Read, bufferSize);
- }
- public static Stream OpenStandardOutput ()
- {
- return Console.OpenStandardOutput (0);
- }
- [SecuritySafeCritical ]
- public static Stream OpenStandardOutput (int bufferSize)
- {
- return Console.Open (MonoIO.ConsoleOutput, FileAccess.Write, bufferSize);
- }
- [SecurityCritical ]
- public static void SetError (TextWriter newError)
- {
- if (newError == null)
- {
- throw new ArgumentNullException ("newError");
- }
- Console.stderr = newError;
- }
- [SecurityCritical ]
- public static void SetIn (TextReader newIn)
- {
- if (newIn == null)
- {
- throw new ArgumentNullException ("newIn");
- }
- Console.stdin = newIn;
- }
- [SecurityCritical ]
- public static void SetOut (TextWriter newOut)
- {
- if (newOut == null)
- {
- throw new ArgumentNullException ("newOut");
- }
- Console.stdout = newOut;
- }
- public static void Write (bool value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (char value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (char[] buffer)
- {
- Console.stdout.Write (buffer);
- }
- public static void Write (decimal value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (double value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (int value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (long value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (object value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (float value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (string value)
- {
- Console.stdout.Write (value);
- }
- [CLSCompliant (false)]
- public static void Write (uint value)
- {
- Console.stdout.Write (value);
- }
- [CLSCompliant (false)]
- public static void Write (ulong value)
- {
- Console.stdout.Write (value);
- }
- public static void Write (string format, object arg0)
- {
- Console.stdout.Write (format, arg0);
- }
- public static void Write (string format, params object[] arg)
- {
- if (arg == null)
- {
- Console.stdout.Write (format);
- }
- else
- {
- Console.stdout.Write (format, arg);
- }
- }
- public static void Write (char[] buffer, int index, int count)
- {
- Console.stdout.Write (buffer, index, count);
- }
- public static void Write (string format, object arg0, object arg1)
- {
- Console.stdout.Write (format, arg0, arg1);
- }
- public static void Write (string format, object arg0, object arg1, object arg2)
- {
- Console.stdout.Write (format, arg0, arg1, arg2);
- }
- [SecurityCritical , CLSCompliant (false)]
- public static void Write (string format, object arg0, object arg1, object arg2, object arg3, __arglist)
- {
- ArgIterator argIterator = new ArgIterator (__arglist);
- int remainingCount = argIterator.GetRemainingCount ();
- object[] array = new object[remainingCount + 4];
- array [0] = arg0;
- array [1] = arg1;
- array [2] = arg2;
- array [3] = arg3;
- for (int i = 0; i < remainingCount; i++)
- {
- TypedReference nextArg = argIterator.GetNextArg ();
- array [i + 4] = TypedReference.ToObject (nextArg);
- }
- Console.stdout.Write (string.Format (format, array));
- }
- public static void WriteLine ()
- {
- Console.stdout.WriteLine ();
- }
- public static void WriteLine (bool value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (char value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (char[] buffer)
- {
- Console.stdout.WriteLine (buffer);
- }
- public static void WriteLine (decimal value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (double value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (int value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (long value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (object value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (float value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (string value)
- {
- Console.stdout.WriteLine (value);
- }
- [CLSCompliant (false)]
- public static void WriteLine (uint value)
- {
- Console.stdout.WriteLine (value);
- }
- [CLSCompliant (false)]
- public static void WriteLine (ulong value)
- {
- Console.stdout.WriteLine (value);
- }
- public static void WriteLine (string format, object arg0)
- {
- Console.stdout.WriteLine (format, arg0);
- }
- public static void WriteLine (string format, params object[] arg)
- {
- if (arg == null)
- {
- Console.stdout.WriteLine (format);
- }
- else
- {
- Console.stdout.WriteLine (format, arg);
- }
- }
- public static void WriteLine (char[] buffer, int index, int count)
- {
- Console.stdout.WriteLine (buffer, index, count);
- }
- public static void WriteLine (string format, object arg0, object arg1)
- {
- Console.stdout.WriteLine (format, arg0, arg1);
- }
- public static void WriteLine (string format, object arg0, object arg1, object arg2)
- {
- Console.stdout.WriteLine (format, arg0, arg1, arg2);
- }
- [CLSCompliant (false), SecurityCritical ]
- public static void WriteLine (string format, object arg0, object arg1, object arg2, object arg3, __arglist)
- {
- ArgIterator argIterator = new ArgIterator (__arglist);
- int remainingCount = argIterator.GetRemainingCount ();
- object[] array = new object[remainingCount + 4];
- array [0] = arg0;
- array [1] = arg1;
- array [2] = arg2;
- array [3] = arg3;
- for (int i = 0; i < remainingCount; i++)
- {
- TypedReference nextArg = argIterator.GetNextArg ();
- array [i + 4] = TypedReference.ToObject (nextArg);
- }
- Console.stdout.WriteLine (string.Format (format, array));
- }
- public static int Read ()
- {
- return Console.stdin.Read ();
- }
- public static string ReadLine ()
- {
- return Console.stdin.ReadLine ();
- }
- [SecuritySafeCritical ]
- static Console ()
- {
- Encoding inputEncoding;
- Encoding outputEncoding;
- if (Environment.IsRunningOnWindows)
- {
- outputEncoding = (inputEncoding = Encoding.Default);
- }
- else
- {
- int num = 0;
- Encoding.InternalCodePage (ref num);
- if (num != -1 && ((num & 268435455) == 3 || (num & 268435456) != 0))
- {
- outputEncoding = (inputEncoding = Encoding.UTF8Unmarked);
- }
- else
- {
- outputEncoding = (inputEncoding = Encoding.Default);
- }
- }
- Console.SetupStreams (inputEncoding, outputEncoding);
- }
- }
- }
复制代码 控制台当然是有的 只不过这个是底下那个调试控制台 并不是真正在PSV上显示
想在屏幕上打行字的话用SampleDraw.DrawText吧
- public static void DrawText(string text, uint argb, Font font, int positionX, int positionY)
- {
- AddSprite(text, text, argb, font, positionX, positionY);
- DrawSprite(text);
- }
- public static void DrawText(string text, uint argb, int positionX, int positionY)
- {
- AddSprite(text, text, argb, currentFont, positionX, positionY);
- DrawSprite(text);
- }
复制代码 |
|