Symbol Scanner File Transfer in VB.NET
I have been developing a scanning application which my company plans to use on a trial basis. The application is written mainly in VB.NET; please bear in mind I am quite new to the .NET environment. I am using a Symbol MC9090-G scanner to collect barcode data & store it in a simple .CSV file. This bit works fine. I'm running XP & have just upgraded to Visual Studio 2005 with ActiveSync 4.1 linking my scanner and PC via USB. The scanner is running Windows CE 5.0 and .NET Compact Framework 2.0. At the moment I have two file transfer problems which I can't resolve.
1. The most pressing is a manual upload facility. The scanner is successfully uploading data wirelessly to a network share, which is great, but I need a simple routine to "Upload to PC via USB" if the wireless connection is lost for any reason. I'd love to accomplish this directly from the scanning application, but one of our techies said it might be better to develop a simple program which sits on the PC & grabs CSV files from the scanner. I have working routines to read and write files using the filestream, streamreader and streamwriter methods, so no issues there. The problem arises when I try to access the scanner directly from the PC. It can be seen in Windows Explorer as a folder called 'Mobile Device', and I can freely browse remote files on the scanner. But when I try to define a filepath called
"Mobile Device\Data\File1.csv" in VB.NET, it expects to find it on the C: drive of the PC. 'Mobile Device' is actually a top-level folder like 'My Computer' or 'Desktop' which resides above the local hard drive. I've tried experimenting with double backslashes, full-stops etc but can't get it to work. What I'd really like is a kind of 'Mapped Network Drive', so the 'Mobile Device' folder has a physical path like F: or G: on my PC. But so far this is eluding me - any ideas?
2. The wireless upload of data (Wi-Fi) is working, as I said. But problems sometimes arise when establishing a connection to our network, and also when the scanner goes out of radio range, and then back into range again. My program freezes up and gets a managed IO Exception error, because it has lost it's link to the network. What I need is some .NET code that attempts to log onto a shared network folder using domain, username and password, and I need to run this code every time the scanner attempts a wireless operation, to ensure it still has a connection. I have trawled the web without much luck (examples with DirectoryServices and DirectoryEntry seem to throw up TypeLoadExceptions on the scanner - ouch!!) but I know it can be done. Windows CE has a login screen with the option to use a stored password, but unfortunately the environment does not try to reconnect by default.
Sorry about the long post - I know what I'm trying to do may not be best practise, but it will be fine for our needs at the moment. Any code snippets or advice would be much appreciated - thanks
Hi Neill - did you ever find a solution to problem 2 - i'm also developing an app on a symbol barcode reader running win ce 5.0 and need to find some code to access a shared network file and provide the domain, username and password programmatically. If you did find a solution i would be seriously grateful because i can't find any help on the issue and i have no clue as to how to go about doing it!
transfer file from mobile device to pc
How did you accomplish transferring a file from your mobile device to your pc? I'd like to be able to iniate the transfer from the mobile device rather than the pc so the user can dock the pc on any pc and not have to have an app loaded on the pc.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
Last Post: 02-20-2010, 04:17 AM
By boomstick425 in forum VB Classic
Last Post: 01-12-2006, 10:54 AM
By Cynthia Leslie in forum Java
Last Post: 06-09-2001, 07:43 PM
By Yuri in forum VB Classic
Last Post: 05-18-2001, 05:05 AM
By Andrew McLellan in forum Java
Last Post: 05-09-2001, 06:34 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center