Main 方法可以屬於型別 void:
static void Main()
{
//...
}
它也可以傳回 int:
static int Main()
{
//...
return 0;
}
========MainReturnValue.cs===================================================
class MainReturnValue
{
static int Main()
{
//...
return 0;
}
}
===============text.bat=============================================
rem test.bat
@echo off
MainReturnValue
@if "%ERRORLEVEL%" == "0" goto good
:fail
echo Execution Failed
echo return value = %ERRORLEVEL%
goto end
:good
echo Execution Succeded
echo return value = %ERRORLEVEL%
goto end
:end
=====================================================
http://msdn.microsoft.com/zh-tw/library/0fwzzxz2(VS.80).aspx
沒有留言:
張貼留言