|
hi everyone,
i need to write a program (c#) that will do the following:
- list all users existing on the computer
- enter different keys into the windows registry for each of the users (these will be used by another application to enable/disable some of its features).
i could do the first part with ADSI, but this doesn't give me access to the registry or I could access the registry directly, but in this case I don't know how to figure out the keys (and names) of the existing users.
any hints?
thanks,
frankk
|
|
|
|
|
hi,
i'm trying to find a way that i can manage the use of a windows application by making use of an activation code which be used to enable the application and allow the user to use it.
i want to be able to generate a fixed length code of not more than 20 characters..
i have been unsucessfull in searching the web for guidance in this matter...
any help or pointers to articles will be great..
Thanks ,
Afzal Hassen
|
|
|
|
|
It's unlikely that many people will publish their approach to this, because they use it to protect their app. Look into the Cryptography namespace for ideas on established algorithms you can play with to come up with a way to create a code. If you do some sort of hash, never just use the users name, someone will work that out. Put some noise in there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
that makes sense...
thanks Christian
Afzal Hassen
|
|
|
|
|
Hi
Is it possible to integrate set up file for my project and Windows Service in one set up file
Right now i have made set up files for both individual installer one for my projetc set up file and another set up files for Windows Service
pls tell me the procedure for that
Any help
Urgent
Thanks
Sanjeev
|
|
|
|
|
You could make a separate setup project and add all files to that setup.
I don't know how it works with the service installer, but you should be able to integrate that one into the setup as well.
WM.
What about weapons of mass-construction?
|
|
|
|
|
hi WillemM,
Thanks for your reply.
Do u know how to add both set up file in one set up file
I have made two separate set up files
for both two project
thanks
sanjeev
|
|
|
|
|
Hi!
I'm beginer in visual c# and i have a big problem. Please explain me how to work with an acces database from c#. How to read articles from database, how to write and so on. Thank you!
|
|
|
|
|
Google[^] is your friend.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I used in constructor of my panel next string:
SetStyle(ControlStyles.DoubleBuffer|ControlStyles.AllPaintingInWmPaint|ControlStyles.UserPaint,true);
And i Still see flicking...
And Another one question - how to make real double buffering...
For Example i draw very difficult figure on the screen, when i finished, another window covers it, anw on OnPaint message i need to redraw, i would like to get the same image( i've already drawn) on the screen... Something like reserve buffer, that doesnt't change, until i didn't change any data...
|
|
|
|
|
Every time your window gets changed in size, dispose and then recreate a bitmap the size of the screen. Draw your stuff to this bitmap when you do this. In your paint message, just draw the image unscaled to the screen.
Double buffering means to have two bitmaps like this, and to draw to one while the other is displayed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I can't understand, do you know any links about this theme???
Because i got problems with it :
1) Flicking;
2) When i change the size of window it repaints only the old (small) part of window
3) Sometimes my control (Panel), where i draw repaint, then clears with background color...
|
|
|
|
|
If you look up double buffering on google, I'm sure there are plenty of C++ articles that explain the concept. It's really simple, you should draw the image direct to the Graphics object in your Paint handler, and you should have the image already drawn and ready to go.
When you resize your window, it's up to you to set up the drawing code to draw to the new size. Doing what I said will take care of this.
Don't use a panel, just draw the bitmap onto the window.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes i know this method, but it what image ("you should have the image already drawn ")i should draw?
I read that only controls can CreateGraphics...
Will it be the right way, if i dynamicly create a panel, but will not show it on the screen, draw on it, then copy image from it to my form???
|
|
|
|
|
Here is some pseudocode.
class MyForm
{
private Bitmap myBitmap;
MyForm()
{
InitialiseBitmap();
}
OnSizeChanged()
{
InitialiseBitmap();
Invalidate();
}
OnPaint()
{
e.gr.DrawImageUnscaled(myBitmap, 0, 0);
}
InitialiseBitmap()
{
if (myBitmap != null)
{
myBitmap.Dispose();
myBitmap = null;
}
myBitmap = new Bitmap(the size of your drawing window);
using (Graphics gr = Graphics.FromBitmap(myBitmap))
{
draw some stuff on the bitmap
}
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I want to make the start of OXY system coordinates not on the left-top, but left-bottom... Is it possible?
|
|
|
|
|
I'm not sure if there is a transform which does this. Either way, do you want this to work while drawing on a bitmap, for your entire Windows app, or what ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I just want to have point in the left bottom corner when i draw it on the screen with coordinates (1,1) .... So Y scale is inversed....
|
|
|
|
|
Yes, I know
This[^] article is as good as it gets. Otherwise, if you're doing drawing only, you can always invert the image at the end.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi:
Can you please guide how to use SecureSockets in C#? Is there a latent support out natively in the framework or should we necessarily go for a third party or open source library?
Perhaps if you could guide me with some SecureFTP stuff too, it would be great. But it is not still a standard right?
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
http://www.mentalis.org/soft/projects/ssocket/[^]
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
Hello Friends,
I want to inherit from Label control and draw the Text of the lable myself. This is because of the standard Lable control doesn't have any property to justify text within it. How can I use System.Drawing.StringFormat and DrawString method to gain this goal.I want to justify both left and right edges of text ! Like the following sample :
Sample Text
Sample Text
Sample Text
Always there is another way !
|
|
|
|
|
What about the TextAlign property?
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
try this:
StringFormat sf = new StringFormat()
sf.Alignment = StringAlignment.Near;
sf.LineAlignment = StringAlignment.Center; drawParams.Graphics.DrawRectangle(Pens.WhiteSmoke,col.Rec);
drawParams.Graphics.DrawString("Test",yourFondHere,Brushes.Black,yourRectangleHere,sf);
GanDad
|
|
|
|
|
It has been worked.Thank U very much !
Always there is another way !
|
|
|
|