|
Hi,
Is this correct?
I am not sure why I get unknown username or bad password.
Note that the login and password I enter are both correct.
Is there something wrong with the way I am setting the username and password?
Thanks
private void CheckLogin()
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "cscript.exe";
process.StartInfo.Arguments = strScriptPath;
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UserName = "myusername";
System.Security.SecureString strPassword = ReadPassword("password");
}
public static System.Security.SecureString ReadPassword(string password)
{
System.Security.SecureString secPass = new System.Security.SecureString();
for (int i = 0; i < password.Length; i++)
secPass.AppendChar(password[i]);
return secPass;
}
|
|
|
|
|
It doesn't look like that you're setting the password on the process.StartInfo.Password property....
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
This is what I am doing now but still get the same error:
process.StartInfo.UserName = "username";
process.StartInfo.Password = ReadPassword("password");
Any thoughts please?
|
|
|
|
|
Is the account that you're using a domain account? If so, you might need
process.StartInfo.UserName = "domain\username"; for it to work properly.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
HI Experts,
I want to get the BIOS date in my project.Inspite of change in the date from the "Date and Time Properties" the date that i want is the date in the BIOS.
|
|
|
|
|
Hi
Try this
<pre>
RegistryKey RK = Registry.LocalMachine;
RK = RK.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");
Object Date = RK.GetValue("SystemBiosDate");
string ss = Date.ToString();
</pre>
himanshu
|
|
|
|
|
very good answer thanks.
only mention to use these 2 lines b4 them
using System.Security.Permissions;
using Microsoft.Win32;
|
|
|
|
|
You can quety WMI with System.Management Namespace
Here is an example. ReleaseDate property is what you are looking for
private void Form1_Load(object sender, EventArgs e)
{
List("Select * from Win32_BIOS");
}
private void List(string query)
{
ManagementObjectSearcher m = new ManagementObjectSearcher();
m.Query = new ObjectQuery(query);
foreach (ManagementObject mo in m.Get())
{
foreach (PropertyData pd in mo.Properties)
{
if (mo[pd.Name] != null)
{
if (mo[pd.Name] is string[])
{
foreach (string s in (string[])mo[pd.Name])
{
MessageBox.Show(s);
}
}
else
{
MessageBox.Show(pd.Name + ":" + mo[pd.Name].ToString());
}
}
}
}
}
|
|
|
|
|
i could not find the system.management namespace
please help......
|
|
|
|
|
Have you tried adding reference to a .net library and search that list for System.Management.
System.Management dll is in .net since 1.1 version.
|
|
|
|
|
|
Hey every body. I was going to develop a Software which transfers voice and data(in advance I may add Video) in a local network(LAN) for my final Project in my college which helps me to have a good result ............................ So please every body help me on the Pre-requisite ............. i.e tell me ideas as much as you can, which helps me to develop this nice project................................I decided to do the software using C# language.............. Any suggestions!!!
THANK YOU ALL
|
|
|
|
|
So you decided to do this project in C#, without knowing the pre-requisites.
You asked for ideas, so here goes. Find out what you need as prerequisites first, then decide on a language, based on its ability to easily implement that functionality.
Either the course you are on is not very good, or you were playing hookey on the days they covered Planning and Design.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hey dude .... do you think that I am dull?..... do you think that i decided to do such kind of projects without knowing any thing........... I think if u thought like that it is far from the truth ............ You better said to me "keep it up.... do this and dont use like this " and bla bla bla ................... I decided this language because I am good at it than the others(like VB,JAVA,C++) and others .............. so what do you say now?
thank you
|
|
|
|
|
First of all I never said that you were dull. I don't know you, how on earth would I know your mental abilities.
Secondly you are not going to get very far in anything related to programming if you cannot accept being told that your approach/schema/design is not the best way to do a particular task.
As far as keep it up etc. goes, do keep it up. Consider, however, that once you have found the prerequisites for VOIP and it transpires that what you need has not yet been implemented in C#. Do you have the skills to code something this complex from scratch yourself? If so then by all means continue as you are.
In your original post you asked for opinions. I gave mine and it was, and remains,
"Find out what you have to do before deciding on the language to use"
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Ok dude................ Thanks for the suggestion........ You know what............ When you say "it has never been implemented in C#"............ I dont believe that if any body doesnt do it that means i cant do it,,,,,,,,,,,,,,,,,, but I will try my best to come up with the design,,,,,,,,,,,,,,, but the only language I can confidently say is it is C# ,,,,,,,,,,,,,,, I wish i could know more but................ I must have to concentrate on one a specific language and be a master of it for my self............... any says I WILL broaden my thoughts as far as i can............. Thank you
|
|
|
|
|
I did not say "it has never been implemented in C#", I said "What if you find that it hasn't".
But that doesn't matter. Your reply shows a commendable attitude, and I hope that you succeed. Even if you are doing it backwards.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Does anybody know of any simple tutorials on Plugin Architecture that I can wrap my little brain around? I have read quite a few in the past 48 hours and seem to be having difficulty getting my head around it.
While the tutorials/articles were very informative, I found that the projects they created for the articles were very overwhelming and a little too complex for a noob.
Also, I have found a few links relating to the System.AddIns namespace on the MSDN site, but that just made me even more confused because it's completely different from all the other articles I've read. Can anyone offer any advice/ help on this?
Thanks heaps,
jase
|
|
|
|
|
|
Yay thank you very much Curtis, that was very helpful and much appreciated.
Thanks
jase
|
|
|
|
|
No problem! I'm glad I could be of help.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi,
How to Extract/Search Document,Excel-Sheet,etc using Indexing Services
Can anybody give me example.
|
|
|
|
|
I wrote
Random RollOne = new Random();
Random RollTwo = new Random();
dieOne = RollOne.Next(1, 7);
dieTwo = RollTwo.Next(1 , 7);
sum = dieOne + dieTwo;
but dieOne and dieTwo are always equal, how do you make two independent random values?
Edit:
Thanks Mikanu, it works now.
modified on Monday, July 13, 2009 10:43 PM
|
|
|
|
|
The correct way to do that is to create an instance of the Random class and then call one of the following methods:
- Next(Int32 max) // will return a random number smaller than max
- NextByte() // will return a random byte (between 0 and 255)
-
NextDouble()
Here's a code sample which will generate two random numbers, a and b, between 0 and 10
Random rnd = new Random();
int a = rnd.Next(10);
int b = rng.Next(10);
----
<a href="www.mdinescu.com">www.mdinescu.com</a>
|
|
|
|
|
To add to the other post ( which was correct ), there is no such thing as a random number to a computer. It only looks that way. A random sequence is started by what's called a seed value. You can specify a seed value to regenerate the same pseudo random sequence if you need to. If you don't specify one, the current date and time are used. As you can see, you created two random objects with the same seed, so they will both start on the same number.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|