|
thanks a lot, for you responses.
|
|
|
|
|
You might want to try and post this in the ASP.NET forum.
PLEASE reference this at all times when in the forums.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
Hi,
I'm writing a simple application which requires the user to log on. It displays a logon form and if the user passes the security check, the main form is then displayed.
On my logon form I have this:
static void Main()
{
Application.Run(new Login());
}
If the user passes security, I want the logon form to close leaving the main form open but can I do this? I can hide the form but if I close the main form, the application is still running.
Can anyone help?
Thanks
|
|
|
|
|
The trick is to show the dialog before the Application.Run. Trust me - it works. What you end up with is something like this:
static void Main()
{
using (Login login = new Login())
{
login.ShowDialog();
if (login.IsAuthenticated)
{
Application.Run(new MainForm());
}
}
} Of course, there are a couple of assumptions here. One is that your login form has an IsAuthenticated property, and the other is that your main form is called - well MainForm. Anyway, this should give you the general idea.
|
|
|
|
|
using( System.Diagnostics.EventLog evtLog = new System.Diagnostics.EventLog( ) )<br />
{<br />
evtLog.Source = "MyAppName";<br />
evtLog.WriteEntry( "SomeMessage" );<br />
}
Any reason why this would not work when the current user isn't an Administrator? If this is the case, what is the correct way to enable event logging for non-admins?
Regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
dabs wrote: Any reason why this would not work when the current user isn't an Administrator?
Yup. The sys admins have locked down your event log - you need to get them to open the privileges on them.
|
|
|
|
|
You can try using impersonation. Ask your administrator to help you with an account that is privileged to write to EventLog.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello everyone,
I am working on a Browser Helper Object and so far I have been able to hook to HTML document elements.
My question is, is it possible to hook to Flash Objects in the HTML? For example would it be possible to detect if a Button in Flash environment has been click?!
Any information on this would be great. Thank you and happy thanks-giving everyone.
Khoramdin
|
|
|
|
|
Hey all i need help in making an OCR software in C#. Currently i am on a basic stage and finding stuff from where to start i just have basic knowledge about OCR so if u guys have any references from where i can find appropiate information so tell me.
Vicky Shah
Vicky Shah
|
|
|
|
|
Here's a link[^].
Pay particular attention to items 2 & 3.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
Hi everyone.
I just started developing a very simple mailchecker application, which runs in the background and checks for new e-mails on a certain account every 2 minutes.
Or, that was the plan. When the app connects to the POP3 server, it freezes immediately. Here's my code:
private void timer1_Tick(object sender, EventArgs e)
{
MailCheck.Connect("pop.sixhoej.net", 110);
NetworkStream NS = MailCheck.GetStream();
StreamReader SR = new StreamReader(NS);
StreamWriter SW = new StreamWriter(NS);
string output = SR.ReadLine();
if (output == "+OK Hello there.")
{
SW.WriteLine("USER [e-mail address goes here]");
System.Threading.Thread.Sleep(1000);
SW.WriteLine("PASS [password goes here]");
System.Threading.Thread.Sleep(3000);
SW.WriteLine("STAT");
System.Threading.Thread.Sleep(1000);
output = SR.ReadLine();
output = output.Substring(4, 2);
MessageBox.Show("You have " + output.ToString() + " unread mail(s)");
}
} Can you see anything wrong with this code?
Thanks in advance.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
Dont use ReadLine. Your app will get stuck if the reply does not end in a newline.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
Thanks, it's working now.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
Hi,
Is there anyway to add vertical scroll bar in groupbox so that it could scroll down controls added with in?
pardon me for dumb question but since i am not regular to .NET, specially desktop so often get stuck in little things.
|
|
|
|
|
Haven't done this, but I expect the following can work for you:
- create the GroupBox
- add one autoscrolling Panel to it (Panel.AutoScroll)
- add whatever Controls you want to appear in that Panel
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hey all,
I recently completed it some applications which run smoothly and perfectly on the computer i developed it.
However when i run the application elsewhere it throws an exception that it does not in the main computer... what could be possibly happening here?
I have installed IIS on the computer and when i am running the application i go to the project/bin/release folder and run the program, but it does nothing that throw that exception....
I have previously finished some applications on other computers and there are fine but i wonder why this is not working!
Any tips?
Thanks all,
PS: I got some new books and hopefully after reading them and learning how to explode C# i will be able to help out here as much as i am been helped!!!!
Luis E Tineo S
|
|
|
|
|
Perhaps the version of .NET Framework on the other computer is older than the version on the computer the app was developed on.
Try updating the .NET Framework on the other computer to the newest version.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
If updating your .Net environment doesn't work, then your application my not have security permissions to do whatever it is trying to do (read/write to the file system, install applications, run third party applications, etc.). Try raising the trust level of the application and running it as an administrator on the computer. Let us know if it works.
Jeff
|
|
|
|
|
kingletas wrote: learning how to explode C#
Generally speaking, C# programs rarely explode.
Division by zero exceptions however may result in unpleasant consequences...
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi!
The first and most important tip is to read and understand the exceptions you get!
Just saying "it throws an exception - what can be wrong" is like going to a doctor and telling him "sometimes something hurts. Help me!" .
If you tell us the exception and where it occurrs, we might be able to help you without having to resort to our crystal balls...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
mav.northwind wrote: we might be able to help you without having to resort to our crystal balls...
I like resorting to my crystal balls. It feels so good when you get the answer right;).
|
|
|
|
|
Pls refer to my earlier post about 10 hrs ago and with same subject
I am still seeking for help.
May be people from other timezone may help.......
Pls take pains to get there
if I copy my earlier message the indents are lost and the code looks rubbish so cant do that
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
Have you considered it using the Process Class? I think since most programs have an Install/Uninstall program you can use Process.Start() to execute these programs to do it and pass the parameters they take to completely uninstall!
I know this sounds too easy but i am not experienced on programming but that is how i would do it at first and then enhance it!
hope it helps!
Luis E Tineo S
|
|
|
|
|
I looked at your earlier post, and it looks about as efficient as it is going to get. As far as finding installer files, good luck with that, because the only way you will be able to do it is to search recursively through the file system. You could install windows components using the winocmgr command, but other than that you can't expect the OS to provide an *easy* way for you to find all install files that have yet to be run. As far as your other questions, I had no answers, which is why I didn't respond to that post either. At least if you are not going to follow the posting guidelines (by posting the same question twice), provide a link to the referenced thread.
Jeff
|
|
|
|