|
Well first off i was trying to keep my post short.
I have tried many thing everyday for almost a week
and all results were a failure..
Windows will only recognise one type of key
for autoadmin logon to work and when passing
a "null" value, the default key type is created
which if ya check what i was saying earlier
that it has a diff binary value and in turn
windows will reject the key and ask for the password.
So the easy answer would be for me to set
a password, not leave it blank.
but i don't want to do that though.
oh and the passing an array idea
produced the wrong type of key.. REG_MULTI_SZ
and like i was saying that won't work
(for windows auto logon to function)
and here is the code i used..
private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
{
RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true );
string[] strMyArray;
strMyArray = new string[0];
OurKey.SetValue("AutoAdminLogon","1");
OurKey.SetValue("DefaultPassword",strMyArray);
}
So im thinking I found a limitation in the C# Reg Class
that wasn't a problem in the least when
i used c++ before to make the same program.
And if anyone can help me get the desired result ?
That would be great and I thank you kindly in advance !
Oh and to make this perfectly clear !
I didn't make this post to "complain" about C#
Rather to ask for some help..
I am really new to C# and am enjoying learning
all this and have found a way around my problem for now.
And i didn't mean to poop on C#
it has amazed me a lot already in how
easy it is to learn and use.
|
|
|
|
|
hi all ,
how can i detect that my application is running from CD-Rom Drive and not from HD
thank you
|
|
|
|
|
use
Environment.CurrentDirectory
to get the current directory of your application and check it yourself
|
|
|
|
|
Better than the current directory (suggested in the other post) use Application.StartupPath . It will always contain the folder where the EXE is located, even if the application changes the current directory (possible and more or less common.)
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
after drawing an ellipse on the form i want that if anyone clicks on the ellipse, it's properties should be displayed in a message box.
anyone with any one pls do mail me.
thanx a lot
Er.Tushar@gmail.com
|
|
|
|
|
hi there,
HW I guess (If not, my apologize)
just few hints look at Region and GraphicsPath classes.
I think it should be easy...
MSDN[^]
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi, i want to send mouse click like "SendKeys", can I do it with shell or what should I use for it?
|
|
|
|
|
Can anyone point me to any opensource C# finite automations software or something that can be related to finite automations theory? Any link on this subject is greatly appriciated.
Thanks in advance!
|
|
|
|
|
|
Hate to disapoint you but I already saw and read that...
Thanks anyway
|
|
|
|
|
Hi,
I have created a user login screen for an application. What i want to achieve is the focus of the login button so that when a user hits the enter key the button is triggered that will process the user name and password.
Thanks for any help.
Regards,
Stephen McAllister
|
|
|
|
|
form1.AcceptButton = your_button.
Process the user name and password from the your_button click event.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Now i am doing dragdrop with my usercontrols, such as button. I got these
two; CF_XMLCODE dataformat and
Microsoft.VisualStudio.Designer.Serlization.DesignerSerializationObject
datatype from the e argument of the dragdrop event. However I can't find any
reference about these two. What are they ? How can i use these to retrieve
all data and recreate my draging usercontrol ?
Thank you
|
|
|
|
|
hii
i am trying to make an flowchart kind of editor. i can draw an object. now i want to implement a click event in that object so that whenever it is selected, i can do something. the code for the object class is :
public class MyObject
{
private int m_X;
private int m_Y;
private int m_Width;
private int m_Height;
private string m_Text;
public MyObject()
{
m_X=m_Y=m_Width=m_Height=0;
m_Text=null;
}
public MyObject(int s)
{
m_X=m_Y=m_Width=m_Height=0;
m_Text=s.ToString();
}
public MyObject(int x,int y, int width,int height)
{
m_X=x;
m_Y=y;
m_Width= width;
m_Height= height;
m_Text="M";
}
public MyObject(int x,int y, int width,int height,string s)
{
m_X=x;
m_Y=y;
m_Width= width;
m_Height= height;
m_Text=s;
}
public MyObject (string s)
{
string[] temp = new string [5];
char[] c = new Char [2];
c[0] = ';';
temp = s.Split(c,6);
X= Int32.Parse (temp[0]);
Y=Int32.Parse (temp[1]);
Width = Int32.Parse (temp[2]);
Height = Int32.Parse (temp[3]);
Text = temp[4];
}
public int X
{
get { return m_X;}
set { m_X= value;}
}
public int Y
{
get { return m_Y;}
set { m_Y= value;}
}
public int Width
{
get { return m_Width;}
set { m_Width= value;}
}
public int Height
{
get { return m_Height;}
set { m_Height= value;}
}
public string Text
{
get { return m_Text;}
set { m_Text= value;}
}
public void Draw (Graphics g)
{
//Graphics g= f.CreateGraphics();
g.DrawEllipse(System.Drawing.Pens.Chocolate ,X,Y,Width,Height);
g.DrawString(Text,new Font("Arial",12),System.Drawing.Brushes.BlueViolet,X,Y);
}
public void WriteToFile(StreamWriter w)
{
w.WriteLine(X +";"+Y + ";" + Width + ";" + Height + ";" + Text);
}
public void Delete()
{
// this.Finalize ();
}
}
}
Please someone help me that if how do i do this : if i click this object then a messagebox if poped up !
thanx in advance
|
|
|
|
|
Create your object as a new user control in your project (Add new item, UI, User control).
The simply add the object to you main from (from the toolbox/My User Controls) and progam the "click" event for the object.
|
|
|
|
|
this is not a user control.
i even tried inheriting my class from usercontrol but then also the click event is not working.
The click event only works on the form. its not working on the Myobjects.. i don't know y.
I feel as if i am totally lost..
please someone help me !!!
|
|
|
|
|
piscian1982 wrote:
The click event only works on the form. its not working on the Myobjects
Because your object is not a control that can trap user events. It draws itself on the form, but you would need the form to trap the click event and forward to your object.
Or your object could install an event handler for the Click event of the form, and check in the delegate if the location of the click is inside your object, and if so, react accordingly. If the point is outside your object, just let the form process its event.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I'm not sure but, in _KeyPress event of a textbox, if you add the code "e.Handled = true;", it works fine. The event is cancelled. But in _KeyDown event it doesn't work.
<br />
private void t2_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
e.Handled = true;<br />
}<br />
Is this a bug? or am I missing something?
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
Yes, it's a bug, it has been fixed in .NET 2.0
Regards
Senthil
|
|
|
|
|
Thanks Senthil.. Same goes for ComboBox control too..
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
hello,
I want to use custom authentication in my web service project. I use asymetric cryptography for loging on the clients. if its OK. I use symmetric cryptography. In brief like that:
1.clients requests the public key of asymetric cryptography from server.
2.server generates and returns it to the client.
3.client encrypts its username, password and the symmetric cryptography's public key and IV and sends them to the server.
4.Server decrypts and authenticates the username and password. if its OK, generates a GUID ticket and encrytp the ticket using the clients public key and IV and sends it to the client.
5.When client calls a webmethod, it send the encrypted ticket and server authenticates the ticket.
I have doupts about the safety of this system.
Can any other person access to the ticket and call a webmethod by using this ticket. What should ı do more?
|
|
|
|
|
|
I am still working on a project to autofill an html form with text fields automatically from a text file. I am running into some trouble. Autofilling on my system is easy. How do you do it when the html is in the browser and on the author's website? I guess it is comparable to google's autofill except im importing from a text file.
ideas?
|
|
|
|
|
I am building a Tetris clone as a tutorial project. I am using a Panel control as the main playing area. The pieces are made up of four Panels that I add to the main playin area panel. When lines are completed I remove the row of Panels by first setting them invisible, performing other tasks, then at the end of the function, removing any invisible Panels:
<br />
foreach ( Panel pnlTmp in this.pnlMain.Controls ) {<br />
if ( pnlTmp.Visible == false ) {<br />
this.pnlMain.Controls.Remove(pnlMain);<br />
}<br />
}<br />
This works great, but as the game goes on, performance starts to take a nose dive. If I do a:
<br />
this.pnlMain.Controls.Clear();<br />
Performance is restored, but I can't keep clearing out ALL the Panels. So it SEEMS that the removed Panels aren't REALLY removed. How do I fully remove them from the main Panel, so that they are truly gone, and performance doesn't suffer more and more as lines are removed?
Thanks!!!
- invid
|
|
|
|
|
centiipede wrote:
// remove the panels
foreach ( Panel pnlTmp in this.pnlMain.Controls ) {
if ( pnlTmp.Visible == false ) {
this.pnlMain.Controls.Remove(pnlMain);//presumably you meant pnlTmp here...
}
}
you might also need to add
<br />
pnlTmp.Dispose();<br />
pnlTmp = null;<br />
to insure it gets garbage collected reasonably soon.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|