六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

桌面端的移動運算(3)

[摘要]Moving Files on a Device也許你會遇到需要在設備上移動或者重命名一個文件的情況。例如,你也許想在拷貝一個新版本的文件到設備上之前先為配置文件做一個備份。該功能的演示界面如圖2。...
Moving Files on a Device
也許你會遇到需要在設備上移動或者重命名一個文件的情況。例如,你也許想在拷貝一個新版本的文件到設備上之前先為配置文件做一個備份。該功能的演示界面如圖2。


Figure 2. The Move File tab of the RAPI demo program

OpenNETCF.Desktop.Communication命名空間RAPI類提供了MoveDeviceFile方法用于移動或重命名一個文件。作為CopyFile方法,這個方法將源文件作為第一個參數,將目的文件作為第二個參數。

BtnMovePerform按鈕的點擊事件過程演示了MoveDeviceFile方法。

[VC#.NET]
private void btnMovePerform_Click(object sender, System.EventArgs e)
{
// Perform the move.
try
{
if ((txtMoveSource.Text == "") (txtMoveDestination.Text == ""))
{
MessageBox.Show("You must provide both a source and destination
file.",
"Missing File Information");
}
else
{
myrapi.MoveDeviceFile(txtMoveSource.Text, txtMoveDestination.Text);
MessageBox.Show("Your file has been copied.","Copy Success");
}
}

// Handle any errors that might occur.
catch (Exception ex)
{
MessageBox.Show("The following error occurred moving the file " +
ex.Message,"Connection Error");
}

}
[VB.NET]
Private Sub btnMovePerform_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnMovePerform.Click

' Perform the move.
Try
If (txtMoveSource.Text = "") Or (txtMoveDestination.Text = "") Then
MessageBox.Show("You must provide both a source and destination
file.", _
"Missing File Information")
Exit Sub
End If

myrapi.MoveDeviceFile(txtMoveSource.Text, txtMoveDestination.Text)

MessageBox.Show("Your file has been copied.", "Copy Success")

' Handle any errors that might occur.
Catch ex As Exception
MessageBox.Show("The following error occurred moving the file -"
& ex.Message, _
"Move Error")
End Try

End Sub
Deleting Files from a Device
你會發現你會經常在使用RAPI拷貝文件的同時使用刪除文件的方法。比如,你的桌面程序也許會從設備上拷貝一個應用程序用來存儲數據的文件,然后在成功執行拷貝任務的基礎上,正確轉換并從設備上刪除該文件,使移動應用程序準備開始重新刷新。該操作的界面如圖3。


Figure 3. The Delete File tab of the RAPI demo program

OpenNETCF.Desktop.Communication命名空間RAPI類提供DeleteDeviceFile方法用來刪除設備文件。你想刪除的文件作為該方法的第一個參數。

BtnDeletePerform按鈕的點擊事件演示了DeleteDeviceFile方法。

[VC#.NET]
private void btnDeletePerform_Click(object sender, System.EventArgs e)
{

// Perform the delete.
try
{
if (txtDeleteFile.Text == "")
{
MessageBox.Show("You must provide a file to delete.",
"No File Provided");
}
else
{
myrapi.DeleteDeviceFile(txtDeleteFile.Text);
MessageBox.Show("Your file has been deleted.", "Delete Success");
}
}

// Handle any errors that might occur.
catch (Exception ex)
{
MessageBox.Show("The following error occurred while deleting the
file -" +
ex.Message, "Delete Error");
}
}
[VB.NET]
Private Sub btnDeletePerform_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnDeletePerform.Click

' Perform the delete.
Try
If (txtDeleteFile.Text = "") Then
MessageBox.Show("You must provide a file to delete.", _
"No File Provided")
Exit Sub
End If

myrapi.DeleteDeviceFile(txtDeleteFile.Text)

MessageBox.Show("Your file has been deleted.", "Delete Success")

' Handle any errors that might occur.
Catch ex As Exception
MessageBox.Show("The following error occurred while deleting the
file -" & ex.Message, _
"Delete Error")
End Try

End Sub
現在我們來回顧一下文件相關的三個方法:拷貝,移動和刪除。下面我們來看看如果從桌面程序中在設備上啟動一個應用程序。






主站蜘蛛池模板: 一二三四在线观看免费高清网 | 四虎在线永久免费观看 | 色天使在线播放 | 人人爱人人插 | 在线观看视频h | 欧美一区二区三区影院 | 探花2700视频| 日韩私人影院 | 中文字幕在线免费观看 | 日本在线观看永久免费网站 | 五月天婷婷在线视频 | 天天天天天天天操 | 小小的日本动漫在线观看免费高清 | 日韩视频免费 | 青久草视频| 伊人精品在线观看 | 啪啪免费小视频 | 亚洲免费网站在线观看 | 天天射天天操天天 | 色婷婷.com | 四虎hu| 色噜噜噜噜噜在线观看网站 | 最新国产在线 | 午夜在线播放 | 欧美夜夜爽 | 色噜噜狠狠一区二区 | 日韩欧美极品 | 一区二区三区欧美日韩 | 日韩 欧美 国产 亚洲 中文 | 青青青爽视频在线观看入口 | 青青草原免费在线视频 | 视频福利一区 | 亚洲六月丁香色婷婷综合久久 | 桃花岛高清在线观看 | 日日夜夜天天人人 | 在线观看亚洲欧美 | 亚洲精品中文字幕区 | 日韩欧美成人乱码一在线 | 天天碰夜夜操 | 日韩第一页在线观看 | 亚洲乱码一区二区三区国产精品 |