locked
how to transfer a txt file from my windows mobile 6.5 device to desktop when I connect the mobile to desktop RRS feed

  • Question

  • Hi,

    I have a windows mobile 6.5 application in c# that stores some data in a txt file. The application has a button named "sendfile". Now I want that whenever I connect my mobile device to desktop, that txt file will be transferred to the desktop on the click event of "sendfile". So how to achieve that..

    Monday, December 3, 2012 8:33 AM

All replies

  • On Mon, 3 Dec 2012 08:33:22 +0000, sharmi04 wrote:

    Hi,

    I have a windows mobile 6.5 application in c# that stores some data in a txt file. The application has a button named "sendfile". Now I want that whenever I connect my mobile device to desktop, that txt file will be transferred to the desktop on the click event of "sendfile". So how to achieve that..

    You have two basic approaches

    1) Write a program or function that runs on the mobile device and uses tcp/ip (e.g.
    sockets or ftp). If you use ftp, you will need to work with a server on the "desktop". If
    you don't use it, you should be able to connect to a "share" on the "desktop".

    2) Write a program that uses RAPI on the desktop. You have 3 ways to get this program to
    respond when a device is connected:
    a) Call CeRapiInit. This function will "block" (not return) until a device is connected.
    So you can call it at the head of a loop that will execute whenever a device connects.
    b) Call CeRapiInitEx. This function will always return immediately, with a return code
    that indicates whether a device is connected. You can use this to "poll" for a connection.
    c) Create a string value in the registry key
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect
    on the desktop. The name of the value doesn't matter, so I use the name of the program.
    The "value" of the value should be the full path for the application. Once you do this,
    the program will start whenever a device is connected.

    (I haven't checked forums in a while.)

    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret
    PenFact, Inc.
    20 Park Plaza, Suite 400
    Boston, MA 02116
    www.penfact.com
    r_z_aret@pen_fact.com
    Useful reading (be sure to read its disclaimer first):
       http://catb.org/~esr/faqs/smart-questions.html

    Thursday, January 3, 2013 11:04 PM