Click here to Skip to main content
15,914,070 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionFace detection algorithm? Pin
tuanlm7522-Apr-07 20:28
tuanlm7522-Apr-07 20:28 
AnswerRe: Face detection algorithm? Pin
Christian Graus22-Apr-07 23:09
protectorChristian Graus22-Apr-07 23:09 
QuestionCustom reporting tools [modified] Pin
shreekar22-Apr-07 19:59
shreekar22-Apr-07 19:59 
QuestionWHAT IS THE EQUIVALENT OF THIS CODE IN VB.NET Pin
klaydze22-Apr-07 19:54
klaydze22-Apr-07 19:54 
AnswerRe: WHAT IS THE EQUIVALENT OF THIS CODE IN VB.NET Pin
MatrixCoder22-Apr-07 20:11
MatrixCoder22-Apr-07 20:11 
QuestionHelp with service and logged in user Pin
dBrong22-Apr-07 18:35
dBrong22-Apr-07 18:35 
AnswerRe: Help with service and logged in user Pin
coolestCoder22-Apr-07 19:17
coolestCoder22-Apr-07 19:17 
AnswerRe: Help with service and logged in user Pin
Dave Kreskowiak23-Apr-07 4:13
mveDave Kreskowiak23-Apr-07 4:13 
dBrong wrote:
This seems so restrictive - what's the worth of a service to an everyday programmer?


Services are normally written as servers, like a web server, ftp server, smtp, ... They normally don't impersonate users unless there is a specific permission they need. In that case, a normal user account is created and the permissions on it specifically setup to give the service the rights it needs and no more.

If your app doesn't do anything until a user is logged in, it should be rewritten as a normal application, but one that puts it's interface in the system tray (NotifyIcon class). It'll normally launch from the Run key in the registry or from the All User\Startup folder. This way, it'll always run in the security context of the user that's logged in and you don't have to worry about user switching and impersonation.


dBrong wrote:
I soon realized that the service ran as 'localservice'. Thus it had none of the rights of the logged on user. Nor could it access the users 'Local Data' path.


True. LocalSystem is the default account that a windows service runs under, having no rights to any network resources.


dBrong wrote:
also discovered that I couldn't run another VB.NET app from the service, cause the app was considered part of the service, making it impossible to run a normal app with a user interface.


Services run under a different desktop thatn what the user sees, by default. So any forms or interface elements that you put up don't get shown on the visible desktop. They get shown on a sdesktop that you cannot see! There is a switch in the Services manager that allows a service using the LocalSystem account to show it's interface on the desktop though. You just need to get the Properties page of your service, go to the LogOn tab and you'll see it.


dBrong wrote:
I began to understand that the service would not be able to access SQL - cause it's not a registered user.


Not true. It can't access an SQL database where the connection string is using "Trusted Connection", but it can if the login credentials are supplied for a valid SQL Server account. Access databases are file-based, so any access to one of these requires filesystem rights. If the database is stored on the network, you run into the first problem above. LocalSystem doesn't have network rights, so youre service has to use a user account specifically setup for it.



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionDATAGRID OF VB.NET 2003 AND 2005 Pin
klaydze22-Apr-07 16:04
klaydze22-Apr-07 16:04 
AnswerRe: DATAGRID OF VB.NET 2003 AND 2005 Pin
Dave Kreskowiak23-Apr-07 7:35
mveDave Kreskowiak23-Apr-07 7:35 
GeneralRe: DATAGRID OF VB.NET 2003 AND 2005 Pin
Hansduncan23-Apr-07 10:18
Hansduncan23-Apr-07 10:18 
GeneralRe: DATAGRID OF VB.NET 2003 AND 2005 Pin
klaydze23-Apr-07 18:53
klaydze23-Apr-07 18:53 
Questionusercontrol move messages Pin
lee2322-Apr-07 16:04
lee2322-Apr-07 16:04 
AnswerRe: usercontrol move messages Pin
Dave Kreskowiak23-Apr-07 4:01
mveDave Kreskowiak23-Apr-07 4:01 
QuestionCalendar control dates Pin
Spontrel22-Apr-07 14:43
Spontrel22-Apr-07 14:43 
AnswerRe: Calendar control dates Pin
kubben22-Apr-07 15:02
kubben22-Apr-07 15:02 
GeneralRe: Calendar control dates Pin
Spontrel22-Apr-07 15:34
Spontrel22-Apr-07 15:34 
QuestionNeeds to show database information in listbox via SELECT statement over more tables Pin
keninfo22-Apr-07 9:55
keninfo22-Apr-07 9:55 
AnswerRe: Needs to show database information in listbox via SELECT statement over more tables Pin
Dave Kreskowiak23-Apr-07 7:27
mveDave Kreskowiak23-Apr-07 7:27 
QuestionRead MS Access Table to Text file Pin
IvanIT22-Apr-07 7:19
IvanIT22-Apr-07 7:19 
AnswerRe: Read MS Access Table to Text file Pin
_mubashir22-Apr-07 9:16
_mubashir22-Apr-07 9:16 
GeneralRe: Read MS Access Table to Text file Pin
IvanIT23-Apr-07 6:35
IvanIT23-Apr-07 6:35 
GeneralRe: Read MS Access Table to Text file Pin
Dave Kreskowiak23-Apr-07 6:55
mveDave Kreskowiak23-Apr-07 6:55 
GeneralRe: Read MS Access Table to Text file Pin
IvanIT23-Apr-07 14:56
IvanIT23-Apr-07 14:56 
QuestionMinimize form Pin
eagertolearn22-Apr-07 7:17
eagertolearn22-Apr-07 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.