我需要YYYYMM格式的年份和月份.我正在尝试使用
string yrmm = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString();
Run Code Online (Sandbox Code Playgroud)
但这会返回'20114'而不是'201104'.任何简单的方法来解决这个问题
我有一个带有Main
方法和功能的控制台应用程序.
如何从Main
方法中调用函数?
我知道下面的代码不起作用
static void Main(string[] args)
{
string btchid = GetCommandLine();// GetCommandline is a mthod which returns a string
}
Run Code Online (Sandbox Code Playgroud)