Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. having problem to translate from WinForm to Windows-CE C# program - FTP transfer

having problem to translate from WinForm to Windows-CE C# program - FTP transfer

Scheduled Pinned Locked Moved Mobile
csharpsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gali1978
    wrote on last edited by
    #1

    having problem to translate from WinForm to Windows-CE C# program - FTP transfer i have this code for transfer from Local computer to FTP server its work excellent on WinForm, i must have this on Windows-CE and it dosnt work the code: string MyFile = @"d:\PC.sdf"; string url = "ftp://127.0.0.1/PC.sdf"; FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url); request.Method = WebRequestMethods.Ftp.UploadFile; //request.Credentials = new NetworkCredential("user name", "password"); request.UsePassive = true; request.UseBinary = true; request.KeepAlive = false; //byte[] buffer = File.ReadAllBytes(MyFile); using (Stream reqStream = request.GetRequestStream()) { int count = 0; byte[] buffer = new byte[100]; using (FileStream file = new FileStream(MyFile, FileMode.Open)) { while ((count = file.Read(buffer, 0, 100)) > 0) { reqStream.Write(buffer, 0, count); } } } thanks in advance

    M 1 Reply Last reply
    0
    • G Gali1978

      having problem to translate from WinForm to Windows-CE C# program - FTP transfer i have this code for transfer from Local computer to FTP server its work excellent on WinForm, i must have this on Windows-CE and it dosnt work the code: string MyFile = @"d:\PC.sdf"; string url = "ftp://127.0.0.1/PC.sdf"; FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url); request.Method = WebRequestMethods.Ftp.UploadFile; //request.Credentials = new NetworkCredential("user name", "password"); request.UsePassive = true; request.UseBinary = true; request.KeepAlive = false; //byte[] buffer = File.ReadAllBytes(MyFile); using (Stream reqStream = request.GetRequestStream()) { int count = 0; byte[] buffer = new byte[100]; using (FileStream file = new FileStream(MyFile, FileMode.Open)) { while ((count = file.Read(buffer, 0, 100)) > 0) { reqStream.Write(buffer, 0, count); } } } thanks in advance

      M Offline
      M Offline
      Mehdi Gholam
      wrote on last edited by
      #2

      What error messages are you getting? On WinCE devices you might not have "d:" so check that.

      Its the man, not the machine - Chuck Yeager If at first you don't succeed... get a better publicist

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups