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

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

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






主站蜘蛛池模板: 欧美亚洲综合在线 | 色涩在线观看 | 亚洲成人mv | 婷婷成人丁香五月综合激情 | 亚洲天堂男人在线 | 日本黄大片 在线播放 | 欧美影院久久 | 手机看片国产免费永久 | 日韩免费视频观看 | 午夜色a大片在线观看免费 午夜骚片 | 亚洲大片免费观看 | 深夜福利免费视频 | 在线污污视污免费 | 亚洲精品另类有吗中文字幕 | 亚洲天堂网站 | 四虎永久在线免费观看 | 亚洲人成亚洲精品 | 日韩免费不卡视频 | 欧美一级免费大片 | 天天舔日日干 | 欧美专区一区二区三区 | 欧美特级午夜一区二区三区 | 在线免费日韩 | 四虎精品成人免费影视 | 亚洲欧美日韩在线不卡 | 手机看日韩片 | 午夜成人免费影院 | 天堂v网| 特级黄视频 | 四虎影视免费永久在线观看黄 | 天天摸日日摸人人看 | 亚洲视频色 | 伊人久久大香线蕉资源 | 色综合久久88色综合天天提莫 | 色呦呦视频在线观看 | 青草国产精品久久久久久久久 | 在线岛国片 | 日韩在线看片 | 青草视频app| 青青草国产免费久久久下载 | 深夜视频在线看 |