15,896,730 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by diialer (Top 8 by date)
diialer
12-Aug-11 8:15am
View
P.D: http://msdn.microsoft.com/en-us/library/system.security.principal.aspx
P.D2: Right-Click the dll. For testing add the User Everyone with full privilegs (better with the whole folder)
if this does not help use the method i postet before
export this to a method
if ( ! string.IsNullOrEmpty( user ) )
{
// Call LogonUser to get a token for the user
bool loggedOn = LogonUser( user, domain, password,
9 /*(int)LogonType.LOGON32_LOGON_NEW_CREDENTIALS*/,
3 /*(int)LogonProvider.LOGON32_PROVIDER_WINNT50*/,
out userHandle );
if ( !loggedOn )
throw new Win32Exception( Marshal.GetLastWin32Error() );
// Begin impersonating the user
impersonationContext = WindowsIdentity.Impersonate( userHandle );
}
use method in doSomeThingWithAdministrativePrivilegs()
...
// DO the stuff privilegs needed in here...
put the method doSomeThingWithAdministrativePrivilegs() where your if ( ! string.IsNullOrEmpty( user ) ) ... was
you also can pass the user, password....
doSomeThingWithAdministrativePrivilegs(string user, string domain, string password)
you have to change the following lines in the method:
<$user>, //Administrator or User with administrativ privilegs
<$domain>, //if no domain avalible set computername System.Environment.MachineName it was i think .ToString()...
<$password>,
this is for example the domain administrator or a user who has administrativ privilegs in domain...
AND to use local administrator if possible:
Create manifest file for main application and add
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
<assemblyidentity version="1.0.0.0"
="" processorarchitecture="X86" name="someExecName" type="win32">
<description>Your Program Description
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security>
<requestedprivileges>
<requestedexecutionlevel level="requireAdministrator">
</trustInfo>
diialer
5-Aug-11 10:40am
View
no the problem was that i'd no permissions to create views -.-
work with the solution to create a view and select from the view now...
diialer
5-Aug-11 10:32am
View
just got the rights to create and delete views...
thanks
diialer
5-Aug-11 10:24am
View
already tried this
string selectCommandTemperature = "CREATE VIEW temp AS (SELECT [T/°C] FROM Q3B UNION SELECT [T/°C] FROM Q3D); SELECT TOP " + countTempe + " [T/°C] FROM temp";
also doesn't work...
diialer
5-Aug-11 10:12am
View
How can i create the view in the database?
(the database is far away (geographical) and i only've got permissions to select in 2 databases with about 1000 tables each)
diialer
21-Oct-10 17:56pm
View
Excuse me for the "fake answer" but i'd not see the [Add Comment]-Button.
I tried without invoke the RichTextBox delegate in a new Form without try'ing to manipulate a thread from another class and it works fine. But if i want to write something into the RichTextBox from another class it does not work to color it??
diialer
21-Oct-10 17:39pm
View
You mean like this?
this.BeginInvoke(new MethodInvoker(delegate()
{
int selectionStart = output.Text.Length;
output.AppendText(text);
output.SelectionStart = selectionStart;
output.SelectionLength = text.Length; // Even without this line it does not work...
output.SelectionColor = Color.Red;
}));
First i get the startposition, cuz the RichTextBox is not empty. Then i append the text and start the selection at for example 20 with the length 10 and color it in red.
Still does not work... -.-
diialer
23-May-10 14:35pm
View
thank you very much, found some usefull examples
Show More