delphi利用API函数写串口。 //建立串口句柄 CommHandle:=CreateFile(PChar(ComboBox1.Text),GENERIC_WRITEorGENERIC_READ, 0,nil,OPEN_EXISTING,FILE_FLAG_OVERLAPPEDorFILE_ATTRIBUTE_NORMAL,0); ifCommHandle=INVALID_HANDLE_VALUEthen begin CloseHandle(PostEvent); CloseHand