我在我的POS c#應用程序中使用了極點顯示(E POS)。我有兩個主要問題, 1.我無法完美地清除顯示。 2.我無法設置光標位置。c中的極點顯示問題#
I used some dirty tricks to do these.But I am not satisfied with that code.The following code i used.
代碼: -
class PoleDisplay : SerialPort
{
private SerialPort srPort = null;
public PoleDisplay()
{
try
{
srPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
if (!srPort.IsOpen) srPort.Open();
}
catch { }
}
~PoleDisplay()
{
srPort.Close();
}
//To clear Display.....
public void ClearDisplay()
{
srPort.Write(" ");
srPort.WriteLine(" ");
}
//Display Function
//'line' 1 for First line and 0 For second line
public void Display(string textToDisplay, int line)
{
if (line == 0)
srPort.Write(textToDisplay);
else
srPort.WriteLine(textToDisplay);
}
}
poledisplay-C#標籤是太具體,加入C#和EPOS標籤。 – stukelly 2009-03-01 01:40:17