在波斯语中打印c#DateTime最简单的方法是什么?目前我正在使用:
static public string PersianDateString(DateTime d)
{
CultureInfo faIR = new CultureInfo("fa-IR");
faIR.DateTimeFormat.Calendar = new PersianCalendar();
return d.ToString("yyyy/MM/dd", faIR);
}
Run Code Online (Sandbox Code Playgroud)
这引发了异常
不是给定文化的有效日历
嗨,我需要从字符串创建一个位图文件,目前我正在使用
Bitmap b = new Bitmap(106, 21);
Font f = new Font("Tahoma",5 );
StringFormat sf = new StringFormat();
int faLCID = new System.Globalization.CultureInfo("fa-IR").LCID;
sf.SetDigitSubstitution(faLCID, StringDigitSubstitute.National);
Brush brush = Brushes.Black;
Point pos = new Point(2, 2);
Graphics c = Graphics.FromImage(b);
c.FillRectangle(Brushes.White, 0, 0, m_width, m_length);
c.DrawString(stringText, f, brush, pos,sf);
Run Code Online (Sandbox Code Playgroud)
它有效,但问题是从左到右书写.如何让DrawString()从右向左书写?感谢名单