what is the purpose of DirectoryEntry class? [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I want to develop a console application using C# which gets the IIS Application Pool status information,whether its running or stopped.For this I referred check the status of IIS Application Pool which matches my requirement.
Can someone please clarify what is the purpose of Directoryentry class according to the above code?
Any help is appreciated.
Thankyou.

The Directoryentry class is used here to get IIS application pools and you need to pass username and password to access them.
These required username and password need to be specified in "appsettings.json" file.

Related

is System.Threading.Thread.CurrentPrincipal shared between all users? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I intend to use currentprincipal and I searched that the property is static , so it must be shared, Actually I need it to be different not shared. as I write some code I see the currentprincipal is different after 2 users logged in to application, is it right , can I be sure of being different of the property? Actually my users logged in to application and call my function through WCF! please ask me to clear if my explanation is not enough, thanks in asvance
System.Threading.Thread.CurrentPrincipal returns IPrincipal for current thread. Do your users use the same thread at one moment? I think, no.

Get local path of user with ASP.NET MVC [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Is there any way to execute, get or create any local file by the user specific path? My intension is to create a folder in the user specific local path... something like Y:\newFolder if the user clicks a button in the View ASP.NET MVC. Sorry that I don't have any code sample but I really dont have any idea. Thanks and Greetings!
In a web application there is not actually any user, other than the IIS and the POOL that runs your site.
Now, you application can have users, that you allowed them to logged in, and then where you going to create their files and folders is up to you, and you only.
you can use this
HttpRuntime.AppDomainAppPath
to get your current application path, and from there you can add any folder base on your users.

ASP.NET publish issues [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm guessing I'm doing this totally wrong but I couldn't find how else to do it.
I'm trying to publish my website to a "Test server" online (hosted by One), but everything I try I end up with raw ASPX text on my screen whenever I go to the default webpage.
Using it with the ISS thingy was no problem.
Thanks in advance.
Make sure:
the hosting provider supports ASP.NET hosting
the .NET Framework is installed
ASP.NET is registered in the web server

set windows service connection string on run time [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a windows service I set the ConnectionString from properties.setting it's work on my PC, but when I made the installation and install it on other computer how can I set new connection string. I think it will be manually but I don't know how.Thanks.
When you deploy your service it generates a file named "yourexe.config". If i am right about how you are setting up your connstring, you just need to change it in that file BEFORE you start the service.
Best regards,
Marco Alves.

Changing user process on a system process [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a little problem.The Device Manager is a list of processes. The process my application is active on my user (FoX0X). How to change the process to belong to the system (Replace "FoX0X" to "SYSTEM")? Besides that if you can not close it in the device manager?
I tried to use the code:
File.SetAttributes("AppName", FileAttributes.System);
But this dont work.
You can not change users a process is running under, you may be able to do impersonation to run a section of code as another user, but you can not modify the process itself to be running as another user.
To make your process run as SYSTEM it must be started under that user.

Categories