[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

Advice on writing a logon program

I need to write a program that will launch when a user logs in to their pc. The basic functionality will be to connect the user to the appropiate terminal server. I will be reading the server name from ADP, for that user. Then using the mstsc command with the appropiate server name in the parameters. I have the VB2005 code for all that.
Now, I know the code I need to write. I'm just wondering the best way to do it.
As far as I know, I'll have to run an install program on each pc. There is no way to make an exe?
So, I'd like to make the program as small as possible. Is a Console project smaller that the standard windows project?
Or is there a better way I'm not thinking of?
Keep in mind I wish to stick with VB.net - I don't want to know that there is a better solution in C# or something. :)

Thanks


0
jdhackett
Asked:
jdhackett
  • 4
  • 4
1 Solution
 
RobSampsonCommented:
Hi, if you've got the VB2005 code for doing this, can't you just create an Executable file from the IDE?

If it's just one form, it should be very small, and not have an impact on your login time....

Regards,

Rob.
0
 
jdhackettAuthor Commented:
How do I create an executable file? I thought you had to do the whole publish/install thing?
0
 
RobSampsonCommented:
Hi, I think if you "build" your application, you can find the EXE in the Bin directory....Maybe the bin/debug folder....
I think you also need to change the active configuration to "Release" prior to creating the release build.

This may help:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=841375&SiteID=1

Regards,

Rob.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
RobSampsonCommented:
Hi, did my suggestion help you to build an EXE for your application?

Regards,

Rob.
0
 
jdhackettAuthor Commented:
Yep, it did.
However, there is one more problem.
My program starts like this:
Dim stUserName As String = SplitString(My.User.Name)
Which breaks the name part out, and from there I get the info from active directory. The exe works fine on the local drive of any pc. However, if I put it on the server, which is mapped as the V drive, I get
an 'Index out of bounds' message. I changed the exe to msgbox My.User.Name and it returns an empty string when run on any network drive. That is, it works fine if the exe if on the pc, but not I put it on any mapped drive.
Any idea why this would happen?

0
 
jdhackettAuthor Commented:
Just to update on this. I now My functions don't work in console apps. Even though I have a from in this case, I decided to use try using
Dim stUserName As String = System.Environment.UserName
instead, but now I get permssions error later in the code:
Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

Again, this only happens if exe is run from network drive.
0
 
RobSampsonCommented:
I don't know much about .NET I'm afraid. I would suggest you would be off posting a new question for this new error....maybe some more familiar experts can help....

I did find this, but I'm not sure it will help "across the board"....
http://geekswithblogs.net/timh/archive/2006/03/08/71714.aspx

Regards,

Rob.
0
 
jdhackettAuthor Commented:
Thanks. Since that linked solution means configuring .Net on each pc, I'll just set the script to copy the Exe to the C drive. Probably best way to go anyway.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now