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

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

桌面端的移動運算(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
現在我們來回顧一下文件相關的三個方法:拷貝,移動和刪除。下面我們來看看如果從桌面程序中在設備上啟動一個應用程序。






主站蜘蛛池模板: 午夜激情福利网 | 亚洲国产资源 | 香蕉网站狼人久久五月亭亭 | 日韩精品欧美成人 | 深夜视频在线播放视频在线观看免费观看 | 天堂网在线网站成人午夜网站 | 午夜影院免费视频 | 亚洲图片综合 | 青青青手机在线观看 | 亚洲精品综合在线 | 综合久久久久 | 日韩专区第一页 | 青青热久免费精品视频网站 | 亚洲综合第一 | 一区小说二区另类小说三区图 | 日日a.v拍夜夜添久久免费 | 天天躁狠狠躁夜躁2021 | 日韩精品一区二区三区中文版 | 亚洲精品在看在线观看 | 日韩视频国产 | 午夜国产精品影院在线观看 | 一二三四在线观看免费高清网 | 日日夜夜欧美 | 日韩黄色大片免费看 | 涩涩涩涩涩 | 伊人五月在线 | 日韩免费a级在线观看 | 亚洲欧洲高清 | 小视频在线观看免费播放 | 欧美怡红院免费全视频 | 午夜资源网 | 日韩亚洲一区二区三区 | 亚洲区在线播放 | 天堂网日本 | 色操网| 日韩在线视频免费看 | 亚洲第一区二区快射影院 | 欧美亚洲国产精品久久第一页 | 亚洲欧美日韩国产精品一区 | 午夜影视免费 | 在线观看91精品国产剧情免费 |