|
hi
i want to use ngen to create native image, but i don't know how to use it and where native image of my application save and some information about it.
thanks.
|
|
|
|
|
Once NGEN has been run on your app, simply run your regular application and the CLR will use the NGEN'd bits.
|
|
|
|
|
No, you can't take the native image and copy it to other machines and expect it to work. It doesn't work that way.
|
|
|
|
|
salam sir;
how can made login user form application in c#.net?please help me.
thanks sir
mohammedali
|
|
|
|
|
Create a new form, drop two labels, two textboxes and two buttons on it. Arrange them how you wish, set "UseSystemPasswordChar" on the textbox to be the password etc voila. The actual code implementation will have to be down to you I'm afraid.
|
|
|
|
|
An example of the code to check the entered credentials could be:
private void buttonLogin_Click(object sender, EventArgs e)
{
if (txtPassword.Text == "abc123" && txtUsername.Text == "admin")
{
MessageBox.Show("You are now logged in!");
}
else
{
MessageBox.Show("Wrong password or username!");
}
}
The rest is up to you.
Virtual1ty
--
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Please tell me you didn't post this with all sincerity??
|
|
|
|
|
What do you mean by that? I don't get it. (I'm Danish.)
Virtual1ty
--
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Oh God, you were serious.
|
|
|
|
|
|
Allright, that's it. Is it the source code you are laughing at?
As far as I can see the code is okay.
Please let me know
Virtual1ty
--
"Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Hey there
No, the code logic looks just fine to me, I think he means something else like you're giving the guy the password to set so you can hack him, some sort of a joke you know.. the way he was attaching you was the funny part
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
And keep it as a hard-coded username and password??? What would it take to change the password? Rewriting the app and compiling is not a viable option. What would it take to add additional users too?? How about revoking a user?? Rewriting the app again??
The code is useless, except for a demonstration of the if statement.
|
|
|
|
|
I am working on a feedback form that basically emails the server a small message. The main information that I need in the (outgoing) SMTP server for the user's account.
One problem is how to find the default SMTP server on the user's machine. Considering the following code...,
private bool GetSmtpAccountInfo()
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Internet Account Manager\Accounts\00000001" );
if (key != null)
{
DisplayName = key.GetValue("SMTP Display Name").ToString();
DefaultEmailAddress = key.GetValue("SMTP Email Address").ToString();
SMTPServer = key.GetValue("SMTP Server").ToString();
key.Close();
return true;
}
return false;
} which gets the information from the registry key from the default Internet Account. This still seems to be destined for failure.
Is there a better way?
Any help would be greatly appreciated!
Mark
|
|
|
|
|
Let me first give you a tip, about never to write such sensitive code that is not portable on all systems, a better solution is to use specialized packages and technologies for that, now regarding your question I would 100% go to Perl or Python .Net embedded scripts...
I hope this tip will help you..
To follow the path, Walk with the MASTER, See through the MASTER, Be the MASTER!
|
|
|
|
|
Mohamad K Ayash wrote: Perl or Python .Net embedded scripts...
Can you elaborate on this?
Mark
|
|
|
|
|
Ok this may be a bit complicated, are you planning to create a web application that sends messages to the users SMTP server, if this was the case you may use PHP or ASP.NET built in capabilities to do so and that is generally easy, or if you need it in C# you may access the SMTP port 25 which works similir to ping and hence get a request with the client's SMTP server, without the need to access the registry!!
I hope this helps.
Best Wishes Mark!
To follow the path, Walk with the MASTER, See through the MASTER, Be the MASTER!
|
|
|
|
|
I've done this for one project and because of company policy I couldn't access their SMTP server so I just signed up for a free gmail account and use that SMTP server to send emails to the same email account. I can then access these emails from the web quite easily.
|
|
|
|
|
Ed.Poore wrote: and because of company policy I couldn't access their SMTP server
So you are saying that you are unable to send email through the company server?
If you are sending mail, the SMTP server is the outgoing. So you have to be able to access that server (setting for the user's machine). That is the problem. The target server (for the recipient) is not.
SmtpClient client = new SmtpClient();
client.Host = someServerName;
client.Port = 25;
Mark
|
|
|
|
|
I'm running this short program but it's taking more than an hour to run.
using System;
using System.Collections.Generic;
using System.Text;
namespace TestConsole2
{
class Program
{
static void Main(string[] args)
{
float i = 1; float j = 0;
while (i > 0)
{
j = i;
i++;
}
Console.WriteLine("The maximum value of float is : " + j);
Console.WriteLine("The value of float after overflow is :" + i);
}
}
}
(adapted from http://www.java2s.com/Tutorial/C/0040__DataType/Getmaximumandminimumvaluesofdatatype.htm)
2. Does anyone have a table with c# data types, description and range values, pls?
3. Initially i started out this program because I was looking for an explanation of "when converting an int to a float there can be a loss in precision" (Wrox C# 3rd Ed. pg. 156). Does anyone have a practical example, please?
Jon
|
|
|
|
|
I've got an easier way to do this:
Console.WriteLine("The maximum value of float is : " + float.MaxValue);
Console.WriteLine("The minimum value of float is : " + float.MinValue);
|
|
|
|
|
|
Awww, man, you beat me to it
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Is it possible to display the values in their long format rather than in exponential format, to make it easier for me?
What about the other q's; any idea?
Jon
|
|
|
|