|
No hacker has the required resources.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
No, there are people out there who know how to get the hashes. After that, you have to brute-force dictionary attack the hashes to get the passwords which can take a considerable amount of time.
|
|
|
|
|
Not yet, as far as I know. At least, not if the password isn't short (or findable by a dictionary attack).
On XP and previous, it was trivial to crack that nice LM hash, but Vista+ doesn't store the LM hash anymore.
|
|
|
|
|
<pre lang="c#"></pre>Error 1 An object reference is required for the non-static field, method, or property 'ConsoleApplication_FileTest.Program.GetAverageSalary(string)' C:\Users\Dawn\documents\visual studio 11\Projects\ConsoleApplication_FileTest\ConsoleApplication_FileTest\Program.cs 98 24 ConsoleApplication_FileTest
<pre lang="c#"><pre>static void Main(string[] args)
{
Dictionary<string, double> averages = new Dictionary<string, double>();
string filename = "c:\\test.txt";
averages = GetAverageSalary(filename)
} </pre></pre>
=====================
<pre lang="c#"> Dictionary<string, double> GetAverageSalary(string filename)
{
... </pre>
|
|
|
|
|
Your method main() is static.
Your method GetAverageSalary() is not. So it MUST have an object instance of type Program.
But I suspect you might solve it by making GetAverageSalary() static. However that depends on what you are trying to learn.
|
|
|
|
|
How do I mae an object instance of type Program?
|
|
|
|
|
Xarzu wrote: type Program
Program prg = new Program();
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
..that's why I usually change it to a static class altogether.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
jschell wrote: So it MUST have an object instance of type Program
What's the use of doin' that?
I suspect GetAverageSalary should be in it's own (static?) class
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
Get used to a feeling of Deja Vu - this question comes up in many, many forms repeatedly.
Normally because the tutor is rubbish, or the student didn't pay any attention...
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
It's worth noting here the difference between static and non-static methods, properties and what-not, because it is important, and quite a bit fundamental. Bear with me.
Let's think about the real world: take cars.
How many wheels has a car? Simple question, simple answer: four. A car has four wheels (because if it had two it would be a motorbike). We can happily ask this of any car and expect the same answer.
What colour is a car? Eh? What? You can't ask that, because all cars are not the same colour. My car is Red, your car is Green, that car is Silver, this car is Black. You need to refer to a specific car in order to ask the question.
We call the "Number of wheels" a static property, and "Colour" a non-static property.
Every executable must have one - and only one - static Main method. This is the method that is executed by the framework when you application starts. Hence the need to be static , there must be a single instance of the method that is applicable to the whole application. It cannot be class instance based.
So if you are executing a static method, you do not have a class instance to refer to (or it wouldn't be static , it would be a class related method) So you can't call class related (or non-static ) methods from static code without creating (or otherwise fetching) a class instance for them to refer to.
Unless you declare something as static (or in a class declared as static) then it is always non-static - because most of the code you create will be non-static .
So either your GetAverageSalary method needs to be static , or you need to put it in a class and create a class instance in order to access it, as the others have said.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Reliant Robin? Massive truck-like SUVs? 'Number of wheels' is a good example of a polymorphic, non-static question on RoadVehicle.
A static method must not require any instance state – in C#, including which type of object an instance is (because it doesn't have virtual static methods like, say, Delphi). I typically use it for things which are (in the functional programming meaning) functions.
|
|
|
|
|
BobJanova wrote: Reliant Robin
Have you driven one? It's not a car! :shudder:
(And I deliberately ignored Trikes (used to have one), Sidecars (Can't stand 'em - just don't ask), Vans with two extra wheels at the back, ...)
BobJanova wrote: Massive truck-like SUVs
Drive like a car, taxed like a car, need only a licence for a car, has four wheels. It's a car. Albeit a high, thirsty, heavy one. (My last car was a Shogun / Pajero)
BobJanova wrote: polymorphic, non-static question on RoadVehicle
But harder to understand when dealing with beginners - "Car" is a concept most people understand very easily, allowing you to draw comparisons which are easily understood. It isn't meant to be literally accurate
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
You would be better advised to get a good book on C# programming and spend some time studying the section on classes and objects. Charles Petzold has written a very good introduction to these concepts, which is available for downloading from http://www.charlespetzold.com/dotnet/[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
my question is how can we get progress percentage of acting a method.
for e.g when we are copying a file how can we get the size of copied files in a variable,
or
when our application size is too big, and it takes a while to load it's needed files, how can we understand how much of our application files are uploaded?
suppose that the application has 3 100mb files that are needed to load when our application is executed. what is the way to understand how much of file sizes are uploaded and how much is remained?
you know, exactly I want to have a progress bar control in my first form that shows how much of files are uploaded and when all of them is uploaded completely, it shows a message that application is ready to use.
|
|
|
|
|
What platform? Desktop or ASP.NET?
You load your data with a IDataReader in chuncks, using a backgroundworker[^] for instance. In the read-loop on that background thread, you check how much items/kb has passed, and update the status every 10-50 items.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
thanks for your reply
it's on a desktop platform
but how can I get the passed Items/kb from backgroundworker?
|
|
|
|
|
You create a loop in the worker-thread, and you read a chunk. Then you can report the ReportProgress-method to pass on any progress and/or intermediate results. The main-thread will be notified by an event, and receive both as a parameter.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have a question about a code snippet that a author provided in an article for InfoPath 2007...how can I contact the author or can I get help by asking question here?
Here's the article: Switch Infopath Views from FormControl[^]
I realize it was written long ago - I can't get the form to start due to error...I am using VS 2008 3.5 Framework and c# and InfoPath 2007 on Win 7 64bit machine.
"Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown."
It happens in this line of code:
private void formControl1_InternalStartup(object sender, EventArgs e)
{
//Handle the context Changed event.
((FormControl) sender).EventManager.FormEvents.ContextChanged += FormEvents_ContextChanged;
}
modified 16-Aug-12 11:21am.
|
|
|
|
|
Member 9360291 wrote: how can I contact the author
You can contact the author by posting on the article's message board at the bottom of the article.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks. I guess I was being stupid, I didn't scroll down the page far enough to notice the message board. Sorry about that (new to site is my only excuse). You can delete my post if necessary.
Doreen
|
|
|
|
|
I am making a project in c# with sql on electoral database that consists of 5 fields ie name, dob, family size, etc etc. Now i'm currently unable to create a storage procedure to edit the data in the database, as am unable to understand how to pass the parameter to receive the value being passed from the program. Searching the net hasn't helped me. Can someone assist me with this?
I have uploaded the project with the database, it can be accessed at https://rapidshare.com/files/1397492724/WindowsFormsApplication2.rar[^]
|
|
|
|
|
|
@Shameel: Absolutely. Sorry, i keep typing the wrong name. :P
@Eddy Vluggen: This is for console applications, and more importantly doesnt edit data. It adds, which i am already able to do. My requirement is to edit the data in a form.
Say, a user loads the data. He finds some error. He makes the change, and clicks on edit data, and its done.
|
|
|
|