|
-
Oct 17th, 2005, 07:13 AM
#1
Thread Starter
Addicted Member
Connection paths PDA -> server
Dear All,
I'm new to developing with PDAs, and will be asking quite a few questions about the topic from here on! 
Is there any simple way to tell if my PDA is connected to my PC viewing from the PDA side? I do have code to tell the other way round, but this isn't as muh of a worry. Alternatively, how do I refer to files on a server - how do I structure the path?
Thanks in advance,
Paul.
-
Oct 17th, 2005, 09:03 AM
#2
Fanatic Member
Re: Connection paths PDA -> server
If your PDA has not got a wifi card or grps you can check for an ipaddress (as one is assigned to the device when docked with the pc)
Alternatively you could try a webrequest from the device and if it fails it means its not connected
Or try this code below for checking if activesync is active on the device.
VB Code:
<DllImport("CoreDll.DLL", SetLastError:=True)> _
Private Shared Function CreateProcess(ByVal imageName As String, _
ByVal cmdLine As String, _
ByVal lpProcessAttributes As IntPtr, _
ByVal lpThreadAttributes As IntPtr, _
ByVal boolInheritHandles As Int32, _
ByVal dwCreationFlags As Int32, _
ByVal lpEnvironment As IntPtr, _
ByVal lpszCurrentDir As IntPtr, _
ByVal si() As Byte, _
ByVal pi As ProcessInfo) As Integer
End Function
Public Class ProcessInfo
Public hProcess As IntPtr
Public hThread As IntPtr
Public ProcessId As Int32
Public ThreadId As Int32
End Class
Public Function RunSync()
Dim si(128) As Byte
Dim pi As New ProcessInfo
CreateProcess("\windows\repllog.exe", "/remote", IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, pi)
End Function
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Oct 17th, 2005, 09:24 AM
#3
Thread Starter
Addicted Member
Re: Connection paths PDA -> server
Strider,
Many thanks for your informative and swift reply. I have thought about the ActiveSync choice, but unfortunately the device does not actually end AS automatically.
I've given your suggestion about the IP address a try, and do get a response on that. For some reason, even though the file exists, the FileInfo class I create seems to have a value of nothing, thus the resulting attempt to check for the existence of the file (in the code below) always returns a false, even though the code executes without exceptions.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Check the network to see if we can find a specified file or whatever...
Dim netConnect As New System.IO.FileInfo("\\Morph1\Sys$\Donhost.ins")
TextBox1.Text = netConnect.Exists.ToString
End Sub
Paul.
-
Oct 17th, 2005, 10:03 AM
#4
Fanatic Member
Re: Connection paths PDA -> server
On your device can you access that location ("\\Morph1\Sys$\Donhost.ins") if you browse to it in the File Explorer? Does it ask you for user name and password?
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Oct 17th, 2005, 10:09 AM
#5
Fanatic Member
Re: Connection paths PDA -> server
also you will need make sure that it is a shared directory you are trying to access as otherwise permissions will fail and return false!!!!
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Oct 17th, 2005, 10:32 AM
#6
Thread Starter
Addicted Member
Re: Connection paths PDA -> server
Hmm... I'm not quite sure if the PDA is set-up properly. I think I need to check that more first. It seems that, even though I know the server and share exist and are accessible, that the PDA can't attach.
Thanks for your help, Barry. I think this is a PDA setup issue, so I'm going to have a deeper look at what should be setup and where. 
Paul.
-
Oct 17th, 2005, 10:50 AM
#7
Fanatic Member
Re: Connection paths PDA -> server
what type of device are you using?? pocket pc or windows ce OS??
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Oct 17th, 2005, 10:56 AM
#8
Thread Starter
Addicted Member
Re: Connection paths PDA -> server
I'm using an iPAQ hx4700 running PPC WM2003(2nd Edition). Like I say, though - this is the first time I've ever had the pleasure, and it is quite a nice little box of tricks.
I've got a project on to write an auditable diary system. It's been an uphill struggle all the way. I only started properly using .NET about a couple of months ago. I found that the biggest problem was getting my head around the structure, but now - it's the best thing since sliced bread!!
-
Oct 17th, 2005, 11:16 AM
#9
Fanatic Member
Re: Connection paths PDA -> server
ya its pretty good, but the current version of the .Net compact framework is limited, the full version 2.0 of CF.Net will be released wit visual studio 2005 which i assume will be a lot better.
Also there is an open source community for the .Net framework. www.opennetcf.org
This will come in quiet handy
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Oct 17th, 2005, 11:22 AM
#10
Thread Starter
Addicted Member
Re: Connection paths PDA -> server
Thanks for all your help Barry - you're a star, mate
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|