Re: Write File to Network Drive using Wi Fi connection
From: Paul G. Tobey [eMVP] (ptobey_no_spam_at_instrument_no_spam.com)
Date: 06/22/04
- Next message: Jon Skeet [C# MVP]: "Re: Registry class problem."
- Previous message: Alex Feinman [MVP]: "Re: No SqlServer class in System.Data namespace ???"
- In reply to: jez: "Re: Write File to Network Drive using Wi Fi connection"
- Next in thread: Robert J: "Re: Write File to Network Drive using Wi Fi connection"
- Reply: Robert J: "Re: Write File to Network Drive using Wi Fi connection"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 09:10:27 -0700
That is, if you set up the share manually before the first run of your
application, entering the password, etc. (or having the user do it), if
necessary, then you'd just assume that there is a folder \Network\sharename
on computername, and go from there. If that won't work for you, you'll have
to P/Invoke to the WNET routines (WNetAddConnection, etc.). There may have
been some traffic on doing this before, so check the newsgroup archives.
Paul T.
"jez" <jezonline@hotmail.com> wrote in message
news:40d80f67$0$62377$5fc3050@dreader2.news.tiscali.nl...
> g'd day,
>
> this is exactly what I'm using in my application. I "download" and
"upload"
> files using the copy() or move() method. It's actually extremely easy to
use
> and very fast (using WiFi!).
>
> As for the username/password issue. I haven't found (didn't really look
for
> it) a solution for that. But you only need to enter the username/password
> once and then save it. What I do here is that when I first set up the
pocket
> PC for the users I try to access a shared map. The Pocket PC then asks me
> for a user/pass/domain, I fill it in and click on the save password
> checkbox. Never got that dialog box again.
>
> I supose that would kind of solve your problem.
>
> jez
>
> "Robert J" <paa@bigpond.com> wrote in message
> news:DGKBc.48867$sj4.30757@news-server.bigpond.net.au...
> > Thanks for the suggestions Paul.
> > The third option seems like it should be the easiest.
> > All Servers will be either running NT 4 Server or 2000 Server.
> >
> > All the Servers are internal to the company I work for so I could easily
> > create the same Network share on them with read\write permission set
> > for Everyone.
> >
> > The problem I have and I can't find any documentation on accessing that
> > share using the Compact Framework
> >
> > If on each Server I created the share ReportsToPrint wouldn't this still
> > have to be
> > accessed using something like \\MyServer\ReportsToPrint\MyFile.txt ?
> >
> > I have just tried to do something like that and using the following
code:
> >
> > Dim filename As String = "\\MyServer\ReportsToPrint\MyFiletxt"
> >
> > Dim myFileStream As New System.IO.FileStream(filename, _
> > System.IO.FileMode.OpenOrCreate, _
> > System.IO.FileAccess.Write, System.IO.FileShare.None)
> >
> > ' create a stream reader attach the file stream to it
> > Dim myWriter As New System.IO.StreamWriter(myFileStream)
> >
> > As Soon as I go to open the FileStream the
> > Username:
> > Password:
> > Domain
> > pops up on the emulator, probably because the device isn't logged into
the
> > Domain.
> >
> > Is there any way around this ?
> >
> > Cheers
> >
> > Robert
> >
> > "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> > message news:uiVl4r7VEHA.2816@TK2MSFTNGP11.phx.gbl...
> > > You'll need to investigate quite a bit more thoroughly what will be
> > > available on the server sides at all of your possible deployment
> locations
> > > before we could suggest something that would work in all cases.
> > >
> > > If every server would have FTP running on it, then you could, in
theory,
> > use
> > > FTP to send the data file to the server. However, the FTP protocol is
> not
> > a
> > > lot of fun to implement yourself, so you would probably want to look
at
> > one
> > > of the add-on products for .NET CF which would do that. You should be
> > able
> > > to search for FTP in the Google archives of this newsgroup to get some
> > > suggestions.
> > >
> > >
> >
>
http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&group=microsoft.public.dotnet.framework.compactframework
> > >
> > > If the server will be running a Web server in every case, that is
> another
> > > possibility. The .NET CF's own support for HTTP:/HTML is closer to
> > allowing
> > > you to do this yourself, or, again, you could use the help of an
add-on
> > > product for file upload.
> > >
> > > If the servers are all Windows-based, you might be able to map a
shared
> > > network 'drive' for use by the Windows CE device. I don't recall
there
> > > being any direct support in the Compact Framework for this, but I
could
> be
> > > wrong about that. Once the share was mapped, you could use the
standard
> > > file I/O stuff in .NET CF for the actual file operations (you simply
> > create
> > > the file in a particular location (something like \network\share name
on
> > > computername\desiredfilename).
> > >
> > > Paul T.
> > >
> > > "Robert J" <paa@bigpond.com> wrote in message
> > > news:mYvBc.47507$sj4.5210@news-server.bigpond.net.au...
> > > > Hi,
> > > >
> > > > I need to be able to write a text file and save it to a directory on
a
> > > > Server
> > > > from in my Mobile Device program using VB.Net.
> > > >
> > > > I can do this by calling a Web Service, but all the Servers on the
> sites
> > > > where my app is deployed can not, or will not, be running the .Net
> > > > framework.
> > > >
> > > > What other options do I have FTP using sockets (almost sounded like,
> > > > I knew what I was talking about there) this would all be new to me,
> have
> > > > always used the winsock wrapper in VB 6 in the past.
> > > >
> > > > Can you can access a network folder using the System.IO.Filestream
by
> > > > \\Servername\C:\Folder ?
> > > >
> > > > When I try to connect in this way from my Pocket Pc Device it always
> > > > asks for the Username and Passwords, is this related to permissions,
> > > > and can they be set for the mobile devices.
> > > >
> > > > Still finding my way with .Net and the Compact Framework, so let me
> > > > know if I am barking up the wrong bush.
> > > >
> > > > Cheers
> > > >
> > > > Robert
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Jon Skeet [C# MVP]: "Re: Registry class problem."
- Previous message: Alex Feinman [MVP]: "Re: No SqlServer class in System.Data namespace ???"
- In reply to: jez: "Re: Write File to Network Drive using Wi Fi connection"
- Next in thread: Robert J: "Re: Write File to Network Drive using Wi Fi connection"
- Reply: Robert J: "Re: Write File to Network Drive using Wi Fi connection"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|