利用WM5 實現電話功能
在程序中進行電話撥號
“項目”—“添加引用”—“Microsoft.WindowsMobile.Telephony”—“確定”
Imports Microsoft.WindowsMobile.Telephony
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TestPhone As New Phone
TestPhone.Talk("1001")
End Sub
pashload是應用在linux下的網絡帶寬測試源程序精確度比較高
/////////////////////////////////////
Pathload is a tool for estimating the available bandwidth
of an end-to-end path from a host S (sender) to a host R (receiver).
The available bandwidth is the maximum IP-layer
throughput that a flow can get in the path from S to R,
without reducing the rate of the rest of the traffic in the path.
MD5變換動態鏈接庫文件調用:(delphi例子)
=========================================================================
function transfer(tran:widestring):widestring stdcall external md5.dll name transfer
//edit1為輸入字符,edit2為輸出md5摘要
procedure TForm1.Button1Click(sender: TObject)
begin
edit2.text:=transfer(edit1.Text)
end
procedure senddata
var
i:integer commflg : Boolean
begin
commflg:=true
for i:=1 to 8 do
begin
if not fcomm comml writecommdata(sendbutter,i) then
begin
Commflg=false
break
end
end
end
(4) 接收數據
在編寫基于串口的計算機工業測控時,通常需要由下位機向PC機發送數據以使PC機了解系統的測試數據或下位機的運行狀態,并進而控制下位機的行為。利用Spcomm串口控件接收下位機發送的數據信息的示例代碼如下:
//事件驅動方式接收數據程序
procedure TForm1.CommlReceiveData(sender:Tobject Buffer:Pointer bufferLength:Word)
var
receivedata:array of byte
begin
sleep(100) //等待100ms,保證接收到所有數據
move(buffef ,receivedata,bufferlength)
//將接收緩存區中的數據轉移到數組中
……
end
(5) 關閉串口
在系統開發中,應注意在不使用串口時應及時關閉串口,釋放系統資源,否則可能會影響系統的其它應用。關閉串口的代碼如下:
procedure TForm1.FormClose ( sender TObj ect:var Action:TCIoseAction )
begin
comml.StopComm
end