문제

현재 OpenNetCf.desktop.communication.dll을 사용하여 데스크탑에서 CE 장치로 파일을 복사하고 있지만 오류가 계속됩니다.

'원격 파일을 만들 수 없습니다'

내 개발 환경은 VS2005 (vb.net)입니다.

내 코드 :

ObjRapi.Connect()
ObjRapi.CopyFileToDevice("C:\results.txt", "\results.txt")
ObjRapi.Dispose()
ObjRapi.Disconnect()

누구든지 이것에 뛰어 들었고 당신은 그것을 둘러 볼 수 있었습니까?

감사

도움이 되었습니까?

해결책

나는 이것을 전에 한 번만 접했지만 그 원인이 무엇인지 정말로 기억할 수 없습니다.

코드를 보면서 생각할 수있는 유일한 것은이 줄입니다.

ObjRapi.CopyFileToDevice("C:\results.txt", "\ \results.txt") 

확실하지 않지만 목적지 경로를 다른 것으로 바꿀 수 있습니다. 이 같은:

ObjRapi.CopyFileToDevice("C:\results.txt", "\My Documents\results.txt")

나는 지금 이것을 실제로 테스트 할 수 없지만 왜 그것이 작동하지 않는지 실제로는 모르겠습니다.

편집 : 방금 RAPI를 사용하여 작성한 코드를 살펴 보았습니다. 라인을 복사 할 때 다음과 같이 보입니다.

ObjRapi.CopyFileToDevice("C:\results.txt", "\My Documents\results.txt",True)

끝의 부울은 덮어 쓰기 스위치이며, True로 설정할 수 있습니다.

다른 팁

이 시도

새로운 RAPI로 Dim Myrapi

        If myrapi.DevicePresent = True Then
            myrapi.Connect()

            If myrapi.Connected = True Then
                Windows.Forms.Cursor.Current = Cursors.WaitCursor
                If myrapi.DeviceFileExists("\Backup\stock.txt") Then
                    myrapi.CopyFileFromDevice(Application.StartupPath 

                Windows.Forms.Cursor.Current = Cursors.Default
                MessageBox.Show("File Copied Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)

            Else
                MessageBox.Show("Please Connect to the Mobile Device", "Connection Failed", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
            End If

        Else
            MessageBox.Show("Please Connect to the Mobile Device", "Connection Failed", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
        End If

    Catch ex As Exception
        MsgBox(ex.Message)
    End Try

다음 코드를 사용해야합니다.

op.CopyFileToDevice(@"C:\results.txt", @"\Temp\results.txt");

코드에서 파일을 복사하려는 경로를 언급하지 않습니다.

이것이 당신을 도울 수 있기를 바랍니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top