Friday, July 31, 2009

What is the major difference between vb.net&c#.net?

vb.net


http://en.wikipedia.org/wiki/Visual_Basi...





c#


http://en.wikipedia.org/wiki/C_Sharp





Comparison


http://www.codeproject.com/dotnet/vbnet_...


http://www.harding.edu/USER/fmccown/WWW/...


http://www.dnjonline.com/article.aspx?ID...


How Much C# Does ASP.NET Development requires?

I believe ASP%26gt;NET comes with its own controls etc.. Now I read that C# is sometimes requires to write code that ASP.NET does not provide. My question is simple.:


I know that at this point C# is needed but how much C# should i know? The basics? I am sure that to develop ASP.NET you don't need to know as much C# than if you are a C# software developer.





Thank you.

How Much C# Does ASP.NET Development requires?
.NET (dot net) is a framework which is used, typically, for web development. To that end, you can choose a few different languages to code in. C# and ASP are two such languages. If you are writing a .NET application, you do not need any knowlege of C#. You may choose to write the application in another language if you'd like.
Reply:You will need C# as if you are a software developer because thats what a web developer is; a software developer.





In general how much C# you will need depends on what you want your application to accomplish.





With ASP.NET controls you might end up writing less code, however you you will still need to write C#.





You will not need to go and read an in-depth C# programming book. Just learn the C# as presented in an ASP.NET book for beginners as you go. Usually that suffices for a beginner.





Hope that helps.
Reply:ASP.net isn't a language on it's own. it's part of Microsofts dotnet framework. It supports C#, VB.Net, J# and maybe others. I'm using vb.net myself but c# can be more powerfull if you want to create usercontrols etc. But 99.9% you can stick with vb.net which is a neat language. You'll learn it within a few weeks, you can follow microsofts excellent video-tutorials to get you started
Reply:Boy... a question straight to my heart...





Having just been through this dilemma not more than a month ago, I can tell you that ASP.Net only requires C# (or any other language) if you want to actually do more things than you can get from drag/drop elements and setting properties. If you want any database interaction that isn't 100% canned, you NEED custom programming.





How much do you need? Well, that depends upon what you are doing. Simple processing of webforms to handle what the user inputs requires some or all of the fundamentals of the launguage: Types, Variables and Constants, Expressions, Statements, and Operators. If you want to do any database interaction that isn't canned, you need Classes and Objects, Preprocessor Directives, Arrays, Indexers, Collections, Strings and Regular Expressions.





The only thing you don't need that a desktop application developer does is a knowledge of Windows Forms and how to interact with them. But I find it does help to be at least familiar with the concepts.





Feel free to contact me if you need help. Also, here are a couple of good books for you to read...

peony

How tocompare the dissembled code of C# .Net and Java languages?

This article compares the same program written in the C# and Java languages and then compares the dissembled code of both languages.





Read more on C# .Net and Java at http://www.buzzycode.com/ShowArticles-id...

How tocompare the dissembled code of C# .Net and Java languages?
You cannot compare and make out anything out of it.


Any different tech tv aside from C|NET TV?

http://www.cnettv.com

Any different tech tv aside from C|NET TV?
all the podcasts that tech tv has done since the screensavers show was done. they're all on itunes


How to upload images to MSAcess using asp.net and c#.net?

This would require quite a large answer but I found an article on msdn on how to do it using vb. It wouldn't be too complicated to convert it to c#.





What you need to do it store the image in a BLOB (Binary Large OBject) data type in Access.








Anyway, the article can be found here:





http://support.microsoft.com/kb/103257





Hope this helps


How to minimise runtime errors in c#. net?

I have made a web application, where it needs to connect to database and inserts the details from the two textboxes provided in the aplication. but while in runtime, it generates an error message that





"Sql server doesn't exists or access denied"





All the connection are coded inthe file manually.

How to minimise runtime errors in c#. net?
The connection string should not be hardcoded. It should be stored in a configuration file in one centralised place so that are not obliged to recompile your application every time you need to modify the connection string.





In your case the problem is obviously in you connection string. The error generated is quite self explaining.





In general, runtime errors cannot be avoided but rather handled. You should place code that is susceptible to throw exceptions in try - catch blocks. Code within the try scope is referred to as protected code.





For more info on try catch statements in C#, check out this link:


http://msdn2.microsoft.com/en-us/0yd65es...
Reply:Make sure the connection string defined for the connection object is valid. Check the name of the website or its IP in the connection string and try it in a WebForm and see if it works. If yes, then use it in your web application. Good luck.
Reply:Yep I got to say the same thing


Check the Web.Config file for your connection string..

long stem roses

Api windows ( or source code with c#.net ) for hibernate system and wake up computer with modem ring ?

You can look up the C++ Windows API Power Management functions here:


http://search.msdn.microsoft.com/search/...


-


-


Which is the best language among c#, .net , java ?

i m confused about the language which is best and the scope of language is bright !! but im not able to decide yet !


actually, i want to learn the language which have the capability of hacking and software develpoment ?





so plz plz help me in chosing the language !!!!!!!!!!!!!!!

Which is the best language among c#, .net , java ?
C# has the almost the same synthax as java


both are good
Reply:JAVA obviously, as it involves the creative mind of the programmer. If a programmer is good, that would be reflected by his program and vice-versa.


But .NET technology is developed to make the job easy for the programmer by providing him assistance in reducing the acctual code to be written.


C# is a new kid on the block. Is still to be tested rigourously in the inndustry but is not a promising choise for sure.
Reply:Clarification:





C# is a language designed to be used within .Net


.Net is an application framework platform similar to Java platform


Java is a platform with a single possible development language called Java.





None of them are good for hacking, .Net does have IL pseudo-assembly language I suppose .Net is better on this.





Java is better for regular development.
Reply:as ankit above has said.. its always java..
Reply:Wikipedia is a reliable site to compare C#, .net, java :


http://en.wikipedia.org/wiki/Comparison_...


http://en.wikipedia.org/wiki/Comparison_...
Reply:Go though this link:





http://www.veridicus.com/tummy/programmi...


Hi, I have a problem with C#.NET, any body can help?

I've created a textbox, i want user to enter password on this field,the problem is that the text entered is visible, how can I show those stars (*****) instead of visible password? plz help!!!

Hi, I have a problem with C#.NET, any body can help?
there is a property called "Password" for textbox..





Dude, start using search engines :)
Reply:%26lt;asp:TextBox id="MyText" runat="server" TextMode="Password" /%26gt;


How to make cd formate and hosting one web application done by asp.net using c#?

i have completed asp.net project that is web application .code behind c#.web application project want to make a cd formate (my project is online test abt IQ test contain multiple choice ).

How to make cd formate and hosting one web application done by asp.net using c#?
What application format are you using?

gifts

I have a program coded in C#.net 2003. I need to compile and run this application in Red Hat Linux 9.?

How can i do this?


Pls give me information about a relevant compiler and the procedures I must follow to do this.

I have a program coded in C#.net 2003. I need to compile and run this application in Red Hat Linux 9.?
You can use .Net with a program on Linux called Mono. It allows you to run .NET on Linux.


How to make cd formate and hosting one web application done by asp.net using c#?

i have completed asp.net project that is web application .code behind c#.web application project want to make a cd formate (my project is online test abt IQ test contain multiple choice ).

How to make cd formate and hosting one web application done by asp.net using c#?
Just copy the application to the CD.





Backup the database and copy the backup file to the CD.





Deploying the application on another computer is as simple as copying the application to the root folder of the target computer and marking it as an application under IIS.





The DB has to be restored.





The connection strings in your application (which you should have placed in your web.config file should be changed).





Any other configuration settings should have been placed strictly in your web.config file (so that you do not have to recompile your application when deployed to another server).





Hope this helps.

innia

I'm designing a website using C#.net and i keep getting this error "newline in constant"..help please..

i double click the error to see where it is but it just keeps on highlighting the last parts of some of the lines..when i try to retype the whole statement, it's still there..it usually comes out when i write down codes concerning the dbase..

I'm designing a website using C#.net and i keep getting this error "newline in constant"..help please..
This means that while your assigning a value to a string, you pressed enter (new line).





To avoid this use the @ marker in the beginning of your string like this:





string CommandText = @" My text goes here and inclues a new line


but it doesn't matter because I marked it with an @


";





When you put an "@" at the beginning of a string, your telling the compiler: "there are no special characters in this string.


Just put exactly what I type into the string."





Hope this helps!
Reply:May be you can contact a C# expert at websites like http://getafreelnacer.com/
Reply:post the code or go to a c# forum
Reply:please post the code so i can fix it.


I'm designing a website using C#.net and i keep getting this error "newline in constant"..help please..

i double click the error to see where it is but it just keeps on highlighting the last parts of some of the lines..when i try to retype the whole statement, it's still there..it usually comes out when i write down codes concerning the dbase..

I'm designing a website using C#.net and i keep getting this error "newline in constant"..help please..
please post the code so i can fix it.
Reply:May be you can contact a C# expert at websites like http://getafreelnacer.com/
Reply:post the code or go to a c# forum
Reply:This means that while your assigning a value to a string, you pressed enter (new line).





To avoid this use the @ marker in the beginning of your string like this:





string CommandText = @" My text goes here and inclues a new line


but it doesn't matter because I marked it with an @


";





When you put an "@" at the beginning of a string, your telling the compiler: "there are no special characters in this string.


Just put exactly what I type into the string."





Hope this helps!


What is the difference between microsoft c#.net and microsoft visual studio.net?

the name

What is the difference between microsoft c#.net and microsoft visual studio.net?
Microsoft Visual Studio .Net is a programming suite with which you can program in all the .Net languages (C#, VB.Net, ASP.Net, J#, etc.) it comes also with some tools, depending on the version.





I'm not sure what you mean by Microsoft C#.Net... C# is the name of one of the programming language that Microsoft has developped for the .Net Framework.





They have a tool called Microsoft Visual C# Express that is free and is a tuned down version of Visual Studio that lets you only program with the C# language.
Reply:in microsoft visual studio.net


you will get microsoft C#.net...


c#.net is one of the tools in vs.net...


Whats the best college for programming language (c, c++, .net etc.) in this i want to graduation. tell me.?

Truly good programmers use the right tool for each job and it can be different each time. Once you know one language it is easy to pickup another language, so it doesn't matter which language you choose. I enjoy C# for rapid access development of windows applications. I use C with my embedded systems, because it is fast, efficient, and it is the only compiler provided with the ColdFire processor we use.

Whats the best college for programming language (c, c++, .net etc.) in this i want to graduation. tell me.?
All of them should be decent. In all honesty, most that I've seen are sub-par, including renowned institutions. Many are behind on up-to-date practices and teach you enough to get your feet wet. Look for ones that try to school you in old-school concepts instead of ones that just teach you current trends. MIT is probably the best, as well as other engineering schools.

gerbera

How can i working with USB ports in c#.net or vb.net?

Directly addressing them will be really hard. If the device is a filing system you can manage it in the usual file-system way. If it's something else there are usually libraries for handling such devices, either specifically from the device manufacturer, or generically from MS.





For example cameras and other graphical input devices can be accessed through MS' media libraries.





Custom weather balloon devices ship with their own libraries.


How to add ,save,view the image using c#.net with asp.net?

You can take various approaches to this, but your question seems unclear, so here are the links.... hope one of them does it for you!


Help me to create user system in ASP.Net & C#.net which will be check through out the all pages?

Sorry for Bad English :(


=================


Hello You all greate Web Guru





I am a new bee in Weblogic so dont know much more about the live expriment. I have reffered many books but did not get more information on the user management.





I have created a website of 5 pages. First page is login. I have user FormAuthenticationTicket System. Refered from http://support.microsoft.com/kb/301240/e... . But here is one problem after authentication it automatically redirect to default.aspx not my Securepage.aspx.





- How can I solve this problem





Here I want to following task.





1- At startup when I checked out Remember Me Option Directly Login to user account.





2- I want to check User and its Session in Every page until Browser will not close.





For example as yahoo login system works......





Thanks in advance

Help me to create user system in ASP.Net %26amp; C#.net which will be check through out the all pages?
I usually create a class that derives from System.Web.UI.Page and has overrides for the OnPageLoad() event handler. The class has a member which provides the properties for seeing if a user is logged in.





Simply change any of your pages then to derive from this new class, and they'll make use of your custom login code.


What is the future of asp.net,vb.net and c#.net?

dear friend





no body can predict future but the response .net framework is getting is good and i will say it is good career if u wanna choose it , cos just like java it is platform independent , more support on internet of .net in comparison to java , more tools and toys to play with

What is the future of asp.net,vb.net and c#.net?
Safe for atleast next 5 yrs
Reply:Ur asking about what is the future of Microsoft in next 40 years


asp.net,vb.net and c# are powerful technologies to develop applications and lots of organizations and companies are providing support for these technologies


If u wanna proof then visit www.asp.net and click on resouces button


u will find lots of microsoft partners there

rosemary

How can I write ASP.Net and C#.Net code to donwload a secure file?

I am practicing on the programming in file section in which . I am performing following task..


1- Uploading File(ABCD.bak) in a separate forlder.


2- It can not be donwload without giving USer ID and password.





But I can not write the code to donwload this uploaded file after giving UserID and password. I have written following code for download but it is now working.





Response.write("%26lt;a href=/abcd/abcd/abcd.bak%26gt;Download%26lt;/a%26gt;");





Please suggest me if you want.....





Thanks in advance

How can I write ASP.Net and C#.Net code to donwload a secure file?
Asp.net supports user authorization..


if you are using visual studio 2005, it has a login/register control..





the way it works.. first you create your asp.net project, then you can go to website-%26gt;asp.net configuration. that will open a page to configure your asp.net project. from there you can select security and create users/roles. also you can create folders which are only avaiable to sertain groups. like you would have guests and members.





I don't remember all the details now, you'll have to look more into this.


Where can I download Visual C# .NET 2003?

I wouldn't suggest 2003. It uses the .net framework 1.1 and is getting to be outdated. You can download a free version of 2005 here which uses .net framework 2.0.


http://msdn2.microsoft.com/en-us/express...





This is an express edition, but it fits most needs.


Hi can you help me with this? programming using algorithm in VB.net and C++... plz...=)?

the problem is%26gt;%26gt;%26gt; input 10 numbers, then arrange them in ascending and descending order. e.g.


input: 2,6,7,4,9,8,1,0,3,5





output: ascending%26gt;0,1,2,3,4,5,6,7,8,9


descending%26gt;9,8,7,6,5,4,3,2,1,0








VB.net and C++ are the prog. lang. to be used... thankz!

Hi can you help me with this? programming using algorithm in VB.net and C++... plz...=)?
With VB.net





Put the entries into an array: Dim NumArray as Integer(10)


Then sort the array: Array.Sort(NumArray)


or descending: Array.Reverse(NumArray)





There should be a C++ library for arrays as well, just not familiar with them.
Reply:#include %26lt;stdio.h%26gt;





//return p,q in ascending order


void Order(int *p,int *q) {


int temp;


if(*p%26gt;*q) {


temp=*p;


*p=*q;


*q=temp;


}// use %26lt; for the other way


}





//Buuble sorting of integer array A[]


void Bubble(int *a,int n) {


int i,j;





for (i=0; i%26lt;n; i++)


for (j=n-1; i%26lt;j; j--)


Order(%26amp;a[j-1], %26amp;a[j]);





}





void main() {


int i,n=10;


static int a[] = {0,2,9,5,4,8,7,6,3,1};





cout%26lt;%26lt;"\n\n Initial table A:\n";


for(i=0; i%26lt;n; i++)


cout%26lt;%26lt;a[i];





Bubble(a,n);





cout%26lt;%26lt;"\n\n Sorted table A:\n";


for(i=0; i%26lt;n; i++)


cout%26lt;%26lt;a[i];





cout%26lt;%26lt;"\n\n";


}





//end of file bubble.cpp
Reply:?hun?


Any good download sites lie c-net and softpedia or just places to download somthin cool for free?

http://freewarehome.com/


http://download.com


http://www.goloads.com/


http://www.majorgeeks.com/


http://www.tucows.com/

Any good download sites lie c-net and softpedia or just places to download somthin cool for free?
You download ARES software from softpedia.


it is very useful for downloaading.you can search for your softwares and download them.It is also faster
Reply:www.tucows.com
Reply:here are they.....

wallflower

Connecting to Yahoo Messenger with C++.net?

if u can explain u r question lil bit further it wolud b answereble.

Connecting to Yahoo Messenger with C++.net?
YOUR TRYING THIS AT WORK ARTN'T YOU SHAME ON YOU!!


What are the advantages of C#.NET 2005 over Visual Basic 6.0?

difference betn vb and vb.net


http://www.andreavb.com/forum/viewtopic....


difference between c# and vb .net


http://support.microsoft.com/?kbid=30847...

What are the advantages of C#.NET 2005 over Visual Basic 6.0?
The VB6.0 is easy for programming, but its not suitable large size application.





The C# is easy to program like VB6.0 and it is powerfull like C++. (Because its using OOPs).


Casting string to array in C#.net?

i have done this casting.


what's wrong with it?


exception is-unable to cast string type to array


public Array getRange(string startCell, string endCell)


{





Range range = currentWorksheet.get_Range(startCell, endCell); //Get the cells


//Array array = (System.Array)currentWorksheet.get_Range... endCell);


System.Array array = (System.Array)range.Cells.get_Value(null... the values of the cells


return array;


}

Casting string to array in C#.net?
Umm, it'd help if you say what type of array you're trying to create. If you just want an array of chars then use ToCharArray:





string myString = "This is a string";


char[] myChars = myString.ToCharArray();


What are the (UNIX operation system,Visual C++net,and C++programming)good for?

Unix is an operating system, it can be used as a server or desktop operating system.





Visual C++/.net is a Microsoft product used for creating applications that run on windows based computer.





C++ programming is a (an object oriented) computer programming language that can be used on either Unix or Windows based computers to create software applications.





Dont confuse C++ (the computer language) w/ Visual C++ (which is an application used to build C++ projects or software applications)..

hollyhock

I Need Help in using c#.NET to create Crystal Reports?

i need it like step by step process so that i can do it my own

I Need Help in using c#.NET to create Crystal Reports?
check out planet source code - great site for tutorials. http://www.pscode.com


Where can i find e-book about C#.NET + ASP.NET?

try this:


http://www.chipollo.info

Where can i find e-book about C#.NET + ASP.NET?
If you fancy to use e Book than try Lime wire software. You will find more book than you need.


Try it.


Bye.


Which is better for a beginner? vb.net or c#.net?

VB.Net is much easier. I started with VB.Net and so far it is the easiest to understand and learn. But at the same time it is not a powerfull and C++, C#, or Java. I would start there though. Then work your way up.





VB.Net





Private Sub Button2_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles Button2.Click


PB.Maximum = 1000


For a As Double = 0 To 999


PB.Value += 1


lblCurrent.Text = (String.Format("{0:000}", a))


lblCurrent.Update()


'Format the number, to get the numbers like you want


'Add them to a listbox


lstNumbers.Items.Add(String.Format("{0:0... a))


Next





End Sub





--------------------------------------...


C#








private void Button2_Click(object sender, System.EventArgs e) {


PB.Maximum = 1000;


for (double a = 0; (a %26lt;= 999); a++) {


PB.Value++;


lblCurrent.Text = string.Format("{0:000}", a);


lblCurrent.Update();


// Format the number, to get the numbers like you want


// Add them to a listbox


lstNumbers.Items.Add(string.Format("{0:0... a));


}


}

Which is better for a beginner? vb.net or c#.net?
Either. Actually in the absolute, C# has a slightly more difficult syntax, however that doesn't mean that VB.NET is better for a beginner.





C# is more in demand and not only that, learning its syntax will allow you to easily understand the syntax of many other languages you will likely use with C# for example Javascript.





It is also known that it is easier for C# programmers to read VB.NET code than vice versa.





I suggest you go for C#.
Reply:of course its VB.


Better you have some object oriented programming concepts and go for VB
Reply:v.b





but honestly.. i recommend visual foxpro.. easy to understand easy to use.. easier that v.b.. but similar to v.b
Reply:C#.net


Ihave problems with class in c++.net and also with cin and cout?

and what would that be?

cabbage

How to send sms P.C(Net) to Mobile?

how to send sms comptet to mobile in any web.

How to send sms P.C(Net) to Mobile?
Hi from ur name it seems u are an indian like me


so in india


there are many sites


1%26gt; U can use Yahoo Messenger(10 sms)


2%26gt;Rediff messenger ( 3 sms per no)


3%26gt;www.yaari.com (daily 10 sms)


it is a friends site and (it has invitation based signup so for invitation contact ) it alllows u to send free sms in India.


and nowadays many mobile providers give unlimited sms


u can try them.
Reply:www.interzar.com it does it kk
Reply:You can send SMS messages from a computer using Yahoo Mobile.





A few caveats:





1) You can send only 10 messages a day from each Yahoo account. I think this is to control spam messages.


2) Although sending messages is free, the recipient may get charged by their mobile carrier, depending on their service plan.


3) The messages are sent anonymously, and the mobile user can't reply to you.


What are the advantages of C#.NET 2005 over Visual Basic 6.0?

It's a cleaner, more modern language; it compiles 'tighter' and faster; it's better at handling certain common situations; it has capacity for C/C++ style tricks with "unsafe" code.





Plus, C# developrs tend to make more money.


What is better to learn visual basic.net or c#.net ?

i want to know which language is better for me to learn as i worked with visual basic 6 before .

What is better to learn visual basic.net or c#.net ?
Learn both at the same time.


I use both at my position and they


are very much similar anymore.


But if you want to choose one over the other, go C#
Reply:VB.NET is not only easier, but it does much more for you than C#. I have programmed in both, and I find VB.NET much easier.





Advantage of VB.NET go to Advantages of C# go to http://www.vbrad.com/article.aspx?id=65





Advantages of C# go to http://www.vbrad.com/article.aspx?id=63
Reply:c#.net is the modern way. visual basic is just for the old users that find it hard to learn the new stuff.
Reply:VB6 and VB.NET aren't that different. C#.NET is likely you're best one to learn...
Reply:I prefer C#. It's nice and clean, and it's similar to Java, C, C++. VB 6 was nice to work with, but VB.net has a kludge feel about it.


What's wrong with my C#.net code ,im trying to join a bunch of string and integers together.?

udate.Text = "Hello, " + DateTime.Now.DayOfWeek.ToString().Substr... 3) %26amp; " " %26amp; DateTime.Now.Day %26amp; ", " %26amp; definemonth() %26amp; " : You are not logged in.";


The error is at "Hello, " part it said ''Operator '%26amp;' cannot be applied to operands of type 'string' and 'string"

What's wrong with my C#.net code ,im trying to join a bunch of string and integers together.?
Concatenation in C# is done with + not %26amp;

phlox

Are there any C# .Net programmers in North Andover, Massachusetts?

Want to form a study group, or localized support group? Perhaps meet in person say on a monthly basis, share code, common libraries etc?

Are there any C# .Net programmers in North Andover, Massachusetts?
I was thinking they were called D flats.


What is compiler name for c#.net&vb.net?

Visual Studio .NET

What is compiler name for c#.net%26amp;vb.net?
Good question! not many really goto the core of .net and explore it .





for C# its the csc.exe ,C# compiler


and for vb is vbc.exe , vb compiler





You can find these exes in your visual studio 8 folder.


so if you are working in C# IDE ,your csc compiler will fire up when you compile and convert it to MSIL code which the CLR feeds in on and converts it to Native code..ie your 10101 machine code.
Reply:ken s has givn names of exe's those are not compiler names!


eg.. Turbo C compiler has exe tc.exe compiler name :Turbo C





from exe's it seems name is C# compiler and Visual Basic Compiler








i am not aware of particular names (and i dont think they have(they must be having some code name though) it), but i knw :


each language has its own compiler...


no 1 name


though the entire environment is called Common Language Runtime ...


a lang makes use of 2 compilers:


(1) microsoft's compiler for that particular language


(2) JIT


1 compiler is common to all the languages...Just inTime compiler which converts Microsoft Intermediate language to executable code....................


If i chose C#.NET then chances of geting selected into large companies is les as compare to JAVA.Is tat true?

U can choose as per ur own wish!


for dot NET C#, VB.NET, J#,.... any dotnet language.


for J2EE only Java.


J# is same as Java(simply Microsoft's Java, U can use Microsoft's packages as well as Sun's java packages in J#).


C# is similar to Java.


C# is a Hybrid of Java and C++ with some special features added.





In IT Industry(Large Companies) both C#(.NET) and Java(J2EE) are Used to build Softwares. Also C# and Java are much similar.


U can choose any of them, and shift from one another easily.





______________________________________...


Microsoft Visual J# .NET





Microsoft Visual J# .NET is a development tool that developers who are familiar with the java-language syntax can use to build applications and services on the .NET Framework. It integrates the java-language syntax into the Visual Studio .NET shell. Microsoft Visual J# .NET also supports the functionality found in VJ++ 6.0 including Microsoft extensions. Microsoft Visual J# .NET is not a tool for developing applications intended to run on a Java Virtual Machine. Applications and services built with Visual J# .NET will run only in the .NET Framework. Microsoft Visual J# .NET Redistributable Package is the redistributable package for Microsoft Visual J# .NET. The Redistributable Package will only run applications and services developed with Microsoft Visual J# .NET; Java-language applications written with other Java-language development tools will not run with the Microsoft Visual J# .NET Redistributable Package. Visual J# .NET and Microsoft Visual J# .NET Redistributable Package have been independently developed by Microsoft, and are not endorsed or approved by Sun Microsystems, Inc.





[Courtesy : Microsoft Corporation]





The Java Advantage





By nature java is a pure OOP language. It is the base language to develop applications and services using J2SE , J2EE and J2ME. Java is used for mission critical applications , web applications , intranet sites , etc. By the announcement of Microsoft's Visual J#.NET , the java developer now enjoys access to both the Technologies such as .NET and J2EE.





Simply J2EE Vs .NET can be expressed as follows,





J2EE : One Language (java) , Multiple Platforms.





.NET : One Platform (Windows) , Multiple Languages.





Note : up to now Microsoft officially released CLR for its Windows Platform Only. We should not consider the Mono project for Linux platform by Novell Ximian because it is not supported/authorized by Microsoft.

If i chose C#.NET then chances of geting selected into large companies is les as compare to JAVA.Is tat true?
There is nothing like that.


One who is a pro in what he knows rather than ity bits of everything


is more precious.


c#.net is more powerful language than java.java is only used in distributive computing


How to search "LIVE PROJECTS" online on .net, asp .net using C# .net???

Hi ther!





How can a live project be searched online... like i was looking for Health care management system project and Banking related projects... I need the Dataflow diagrams, the description of the projects like how is the flow of the projects.. what and all modules are involved the desingning like stuffs i need the documentation part of both projects if any one knows where i can get those stuffs please let me know.. or if any one has pls let me know... I had searched for URL's that were posted in Y! answers i didnt find it useful.. Plssss Help me out...





Thanks in Advance!

How to search "LIVE PROJECTS" online on .net, asp .net using C# .net???
you can find what you looking for from


http://smtechnology.org/
Reply:You can search at project assignment help website like http://oktutorial.com/ .

verbena

I'm hoping to study .Net . What shall I study VB.Net or C#.Net? My wish is to work in Web Developing side.

C# is more powerful. So I'd go for that. But...





I would recommend considering learning a language that isn't tied to one company/operating system.





The web has always been open source and hopefully always will be. Microsoft is also losing business share at the moment (albeit very slowly). If you want to be in web development for long periods of time you'd be much better off learning PHP or Python or any system that is open or isn't tied to Microsoft.

I'm hoping to study .Net . What shall I study VB.Net or C#.Net? My wish is to work in Web Developing side.
C# pays better. At least in the Midwest, where I'm located, there is a huge demand for it. I can't remember the last time a headhunter called me looking for VB.Net skills.





But that aside, I enjoyed the time I spent programming VB.Net. It's a good lanugage and easy to learn especially if you have experience with classic ASP. But the market eventually made me switch over.
Reply:definitely c#, because in a sense you're learning more languages than just it.





vb.net is smiliar to visual basic and vbscript,,, which are languages that are rarely used and almost out-dated(except for some IT scripting purposes)





but with c# it'll be easier for you to pick up on java, javascript, c, and c++,,,, and these are the languages to learn and know





in my opinion.
Reply:either one. VB.Net might be a little easier for beginners. But, it is easy to learn the second language after learning the first.


Why it is included that VB.NET,C#.NET etc in visual studio.net what are the differences among those languages

VB = Visual Basic





C# = C Sharp





Visual Basic and C Sharp are both high level programming languages. The .NET versions take advantage of the .NET framework from MS. One of the biggest differences is that with C# you can actual do low level buffering and have to take into account buffer over runs. This means you could actually have data over write part of your executable code while running. Visual basic will not let you do this.


Which is the best Visual C++,C#,C.net Basic or java?

What do you mean by "best"?





Go with C# if...


1) you want to build windows programs, websites, database driven applications





Go with Java if...


1) you like what you just read about C# and,


2) you are willing to accept that your programs will run slow


3) you disike like Microsoft





Go with C++ if...


1) you want to write real-time systems such as flight controls, weather radars, graphics-intensive 3D video games, etc


2) are patient enough to deal with a very big learning curve before your are competent in it.





If you're looking for a career in one of these languanges that will offer lots of demand then C# is your best bet

Which is the best Visual C++,C#,C.net Basic or java?
C++ is the best if you want efficiency/speed, if you want ease of programming, Java tops the list
Reply:There is not a single best language in programming language, that is what I always said, as there is no best language in the world. English, Chinese, Japanese, Korean, Malay, Spanish, etc they all have their pluses and mins.





C++ is a language that is very powerful, yet it's learning curve is very steep.





C# is an easier version of C, but the code won't run as fast as the original C and C++.





C.net is slow to run, just like java-based program (basically because both uses Intermediate Language), and even worse, it isn't cross platform. But it (perhaps) have bright future.





Basic is an easy to learn and use language, yet it is still very powerful enough to make almost all program that you can think of. Basic perhaps is the best language to make quick and dirty program. It's code however is not as fast as C but faster than Java and .NET (except for VB.NET version where VB is as slow as the othere)





java is the only code here that guarantees that a code made with this language will run cross-platformly without any code modification and yet still one of the most powerful language. Java code, however is slow to run.
Reply:To ease of use .Net i.e., Visual studio .Net is the best as it has lots of user friendly interface and it reduces some amount of the work for you.





check it out!!!
Reply:Its JAVA...u can check this book "the complete reference java"


File upload using asp.net and c#.net?

hi,


i have to write code for uploading and downloading files for my website. i was successful in doing this. I am using GridView control to show the files which are in my webserver. The way now i am showing the files is





filename ----- select link


eg: abc.doc ----- select





so when user clicks this select link he will be able to download the file.


But what i want is , if the user directly clicks the file name he should be able to download the file. I am not sure how to do this using GridView control. i dont want the select link beside the filename.





eg: abc.txt





Any help will be appreciated.

File upload using asp.net and c#.net?
The ASP .NET FileUpload control will take care of things. To download, you can use the webclient class in .NET. Some programmers roll their own download, because it is a matter of setting the http header and then sending a stream of bytes (binary for jpegs, for instance).





A nice example of full fledges download/upload controls and folder management in asp .net appeared in asp .net pro - May 2007 "Build a web based briefcase". Take a look.

snapdragon2

Pl explain me following c#.net program..plzz its very urgent..?

using System;


using System.Collections.Generic;


using System.Text;


using System.IO;


using System.Security.Cryptography;





namespace ConsoleApplication1


{


class Program


{


static void Main(string[] args)


{





MD5 mMD5 = new MD5CryptoServiceProvider();


byte[] bHash;


byte[] bBlock = new Byte[512];


StreamWriter[] swWriters512 = CreateWriters( "table.512.fragments." );


/*Repeated for every block size*/


StreamWriter[] swWriters1 = CreateWriters( "table.1. fragments." );


int iLineCounter = 0;


Stream sFileList = File.OpenRead( args[0] );


StreamReader srFileList = new StreamReader( sFileList );


string sFileDataName = srFileList.ReadLine();





while (sFileDataName != null)


{


string sFileDataHash = sFileDataName.Substring( 6, 32 );


if (iLineCounter++ % 10 == 0 )


Console.WriteLine( "Processing {0}.", sFileDataHash);


Stream sFileData = File.OpenRead( sFileDataName );


BufferedStream bsFileData = new BufferedStream( sFileData );


int iCounter = 0;


while ( bsFileData.Read( bBlock, 0, 512) == 512 )


{


bHash = mMD5.ComputeHash( bBlock );


swWriters512[ bHash[0] ].WriteLine( "{0} {1} {2,5}", HashString( bHash ), sFileDataHash, iCounter );


/*Repeated for every block size*/


bHash = mMD5.ComputeHash( bBlock, 499, 1 );


swWriters1 [ bHash[0] ].WriteLine( "{0} {1} {2,5}", HashString( bHash ), sFileDataHash, iCounter );


iCounter++;


}


bsFileData.Close();


sFileDataName = srFileList.ReadLine();


}


srFileList.Close();


CloseWriters( swWriters1 );


/*Repeated for every block size*/


CloseWriters( swWriters512 );








}





static StreamWriter[] CreateWriters( string sFilename )


{


StreamWriter[] swWriters = new StreamWriter[256];


for( int iCounter=0; iCounter %26lt;= 255 ; iCounter++ )


{


swWriters[ iCounter ] = new StreamWriter( sFilename + iCounter.ToString( "x2" ) );


}


return swWriters;


}





static void CloseWriters( StreamWriter[] swWriters )


{


for( int iCounter=0; iCounter %26lt;= 255 ; iCounter++ )


{


swWriters[iCounter].Close();


}


}


static string HashString( byte[] hash )


{


return hash[0].ToString("x2") + hash[1].ToString("x2") + hash[2].ToString("x2") + hash[3].ToString("x2") +


hash[4].ToString("x2") +


hash[5].ToString("x2") +


hash[6].ToString("x2") +


hash[7].ToString("x2") +


hash[8].ToString("x2") +


hash[9].ToString("x2") +


hash[10].ToString("x2") +


hash[11].ToString("x2") +


hash[12].ToString("x2") +


hash[13].ToString("x2") +


hash[14].ToString("x2") +


hash[15].ToString("x2");


}


}








}

Pl explain me following c#.net program..plzz its very urgent..?
Computer Tutorials, Interview Question And Answer


http://freshbloger.com/
Reply:It lookes like its doing some encrytion.


Do some researce on the MD5CryptoServiceProvider Class
Reply:It's decrypting a file using MD5 encryption.


What is the difference between asp.net and c#.net?

.NET is an Environment


ASP.NET is a set of API's for building Web Applications


You can consume this set of API's through programming languages like VB.NET, C Sharp, etc.





Similarly there is ADO.NET, ie. a set of API's for database connectivity

What is the difference between asp.net and c#.net?
Only the coding is dfferent C# is more like java with all it semi colon etc.
Reply:ASP.NET is Microsoft's platform for developing web based applications.





You have to use C# or VB.NET to program an ASP.NET application. That is, C# and VB.NET are programming languages for Microsoft .NET, using which you can develop ASP.NET applications for the internet or Windows Forms applications for the desktop.


What is the difference between VB.NET and C#.NET?

They both are diffrent Langagues.VB.net is based on VB and C# is based on JAVA.

What is the difference between VB.NET and C#.NET?
Both of these are languages that run on microsoft's .NET platform (you need to have installed the .NET runtime in order to execute programs written in these languages).





VB is used a lot for scripting and quick graphical widget design, C# is extremely similar to Java and can do a lot of things VB does.
Reply:VB.net is the newest version of the Visual Basic programming language. C#.net is Microsofts bastardisation of the C programming language. The difference is in the syntax.


Thursday, July 30, 2009

In vb.net optional Byval params() as SqlParameter=Nothing what is in c#.net?

C# does not allow optional paramters, but the good news is that overloading a method is easy, just write:


public void myProc(SqlParamter params[])


{


//Do something


}





public void myProc()


{


//Do something


}





If you absolutely need to have the parameter in the function you will need to pass something either a valid SqlParameter object or null will work but be sure you are validating your params

avender

GridView and DataSets in C#.NET 2.0?

Can anyone give me an example of how to create a gridview in .cs versus just dragging and dropping the gridview on the aspx page?





I created a dataset and called a stored procedure using data adapter, but i do not know how to data bind the data set into the grid view I have.





It seems everywhere I search the gridview examples they have is just dragging and dropping to the page and configuring a datasource.





Does anyone know how to do it with a data set?

GridView and DataSets in C#.NET 2.0?
//connect to database via dataset %26amp; dataadapter


SqlConnection con = new SqlConnection("server=localhost;Initial Catalog=databasename;uid=;pwd=;");


DataSet ds = new DataSet();


SqlDataAdapter da = new SqlDataAdapter("stored proc name", con);


da.SelectCommand.CommandType = CommandType.StoredProcedure;


da.Fill(ds);





//create gridview by code %26amp; bind dataset to it


GridView g = new GridView();


Page.Controls.Add(g);


g.DataSource = ds;


Page.DataBind();
Reply:Dragging and dropping just sets up some basic properties. Load your dataset with data:





grid1.DataSource = yourdataset


grid1.DataMember = yourdataset.datatable (hoisted datatable)


grid1.AutoGenerateColumns = true (this will automatically set up the columns to bind to your datatable)


and most importantly


grid1.Refresh()
Reply:You don't really need to use a DataSet. A Datatable would suffice. You can even only use a SqlDataReader.





Here is the complete code:


%26lt;%@ Page Language="C#" %%26gt;


%26lt;%@ Import Namespace = "System.Data" %%26gt;


%26lt;%@ Import Namespace = "System.Data.SqlClient" %%26gt;








%26lt;script runat="server"%26gt;





protected void Page_Load( object sender, EventArgs e)


{


if ( !Page.IsPostBack ) {


BindGridView();


}


}


private void BindGridView() {


using ( SqlConnection cn = new SqlConnection( "server=.; uid=sa; pwd=; database=Northwind" ) ) {


SqlCommand cmd = new SqlCommand( "GetCustomers" , cn);


cn.Open();


SqlDataAdapter da = new SqlDataAdapter( cmd );


DataTable dt = new DataTable();


da.Fill(dt);





gv.DataSource = dt;


gv.DataBind();


}


}


%26lt;/script%26gt;





%26lt;html xmlns="http://www.w3.org/1999/xhtml"%26gt;


%26lt;head runat="server"%26gt;


%26lt;title%26gt;Untitled Page%26lt;/title%26gt;


%26lt;/head%26gt;


%26lt;body%26gt;


%26lt;form id="form1" runat="server"%26gt;


%26lt;asp:GridView ID="gv" runat="server" AutoGenerateColumns="True"%26gt;


%26lt;/asp:GridView%26gt;


%26lt;/form%26gt;


%26lt;/body%26gt;


%26lt;/html%26gt;





To create the stored procedure, simply execute the following T-SQL against the Northwind Sample DB:


CREATE PROCEDURE GetCustomers AS


SELECT * FROM Customers





Hope this helps.


How to get a C#.NET program to use data in my MySQL database?

I currently have a website with user info and data stored on a MySQL database. I would like to (begin to) create a desktop version of my website, and would like to pull the user's information (such as username and password) from the online database to my local app. Does anyone know of a website that has tutorials to help me accomplish this?

How to get a C#.NET program to use data in my MySQL database?
I haven't used this component, but the recommended way to access databases is to use a Database Provider for that database. That way, if you want to upgrade databases in the future or even maybe migrate to a different database, you might be able to do that by simply replacing the Database Provider





Here is a MySQL Database Provider for dotNET


http://uda.openlinksw.com/dotnet/mt/dotn...





Theoretically, if you use this code, you can use any standard tutorial describing a connection to a different database (like MS SQL) and the application will work.


What is the similar between c and c++.net?

The syntax and grammer.


Does anyone know of some good websites for learning C+, C++, C#.net, VB.Net, JavaScript and other programming.

Would love to learn programming and would like to know if there are any free website that can help be get a quick start.

Does anyone know of some good websites for learning C+, C++, C#.net, VB.Net, JavaScript and other programming.
http://www.codeproject.com


http://www.vyomworld.com


http://www.cprogramming.com


http://www.w3schools.com
Reply:http://codeproject.com


http://www.codeguru.com/


http://programmersheaven.com


http://www.1cplusplusstreet.com


http://google.com
Reply:Try these websites for basics.
Reply:Try www.docmail.com Free and affordable education site

violet

I need the web adress of software project using with C# in ASP.net?

I need any webaddress of softwareproject wich is created in ASP.net with C# language.

I need the web adress of software project using with C# in ASP.net?
You can download any software according to your need..... from


http://hotscripts.com/
Reply:Hi KPR IT ,


Thanks for you ranswer.


jk Report It

Reply:no, but you must install IIS , then you can access your website by useing%26lt; %26gt;http://localhost/*.aspx%26gt;


I need to learn C#.net in Hyderabad, India. Can anyone let me know the best place in town- Thanks in advance..

I don't know about in your town..... but


I'd start by getting some books on C#.net (the red WROX books are great!)





If you need assistance with a particular feature doa search looking for tutorials. For example:





C# DataSet Tutorials





You can also go to groups.yahoo.com and join some of the C# groups there. They are great!

I need to learn C#.net in Hyderabad, India. Can anyone let me know the best place in town- Thanks in advance..
sir go to iiht or jetking or system domain and i think even arena multimedia has a few courses on thes subjecs


thank you


best of luck


How to upload image + c#.net?

1. put a FileUpload control on a Web Page (drag it from the toolbox)


2. put a button on that page


3. on design-mode, doble click on the button (creates and takes you to a click handler)


4. on that code, use the property controlName.HasFile to determine if the use has effectively sent a file


5. use controlName.Save or controlName.FileContent (a Stream) to treat the contents

How to upload image + c#.net?
no idea.....sorry
Reply:You basically upload the image path and then grab it from the db that you are uploading it into and assign it to an image control to display.





However sql i know will allow you to store whole jpeg and gif files in it and retrieve it when needed.


Can someone help with C++.NET?

I am creating a menu for a windows form. The items are save; print; undo; and clear form. I figured out how to make the application exit, but I can't figure out what to do to make the other menu items work.





Also when I run the program it isn't showing the menu in the application. I'm not sure why that is either. Any ideas on what I should do for these problems?





Thanks!





Here's some of what I have:





private: System::Void menuItem6_Click(System::Object * sender, System::EventArgs * e) //to close program


{


Application::Exit();


}





private: System::Void menuItem5_Click(System::Object * sender, System::EventArgs * e) //to print


{





}





private: System::Void menuItem4_Click(System::Object * sender, System::EventArgs * e) //to save


{





}





private: System::Void menuItem3_Click(System::Object * sender, System::EventArgs * e) //to undo last action


{


}

Can someone help with C++.NET?
I found a referance for C#, link below. You should be able to use that as a guide to figure out what to do. Just search for "printToolStripButton_Click" in your favorite search engine. When I need help, I search for the object I'm creating or (Printpreviewdialog or PrintPreviewDialog1) (MenuStrip or MenuStrip1 with Standard Items)or the click event (printToolStripButton_Click) that creates the print call.


http://www.google.com/search?hl=en%26amp;q=pri...

peony

What is the difference between C# and C#.net?

programming language

What is the difference between C# and C#.net?
There is no such thing as C#.net...


C# is a .net language...


So no difference at all.


How to store ms-word file in sql server using asp.net and c#?

the coding details in asp.net with c# to store a word file into sql server database?

How to store ms-word file in sql server using asp.net and c#?
Is if these sites help.
Reply:http://www.dotnetspider.com/technology/k...


Login Form CodeNeeded for C# .Net 2005 with Database Ms Access 2003 or SQL?

HI friends





I am planning to build a Login Form ( Stand Alone Application). its part of my Project .





Here i had 2 Text Boxes Named Username TB and Password TB and a Login Button .


With MsAccess or Sql Server .. my Form has to Validate the data. I dont know How to validate the Username and Password in the Database. Once Validation Got done, Main Form Should Open.





I hope U understood my problem. I Donno How to Look into Database and compare the Username and Password ,the user Enters.





Thank You





Subhash.

Login Form CodeNeeded for C# .Net 2005 with Database Ms Access 2003 or SQL?
gimme ur mail id.





I have whole code but gimme ur mail id but id wnat to use this then u can.





using System;


using System.ComponentModel;


using System.Security.Cryptography;


using System.Text;


using System.Windows.Forms;





namespace pinky


{


/// %26lt;summary%26gt;


/// LoginControl is a free .NET login control with cryptography support.


/// %26lt;/summary%26gt;


public class LoginControl : System.Windows.Forms.UserControl


{


///%26lt;event cref="Successful"%26gt;


/// Raised after a successful Login.


/// %26lt;/event%26gt;


public event System.EventHandler Successful;


///%26lt;event cref="Failed"%26gt;


/// Raised after a failed Login.


/// %26lt;/event%26gt;


public event System.EventHandler Failed;


///%26lt;event cref="Ready"%26gt;


/// Raised after the User clicked on Login. Use this event to monitor LoginControl.


///%26lt;/event%26gt;


/// %26lt;example%26gt; This sample shows how to use Ready.


/// %26lt;code%26gt;


/// private void OnEventReady(object sender, System.EventArgs e)


/// {


/// MessageBox.Show("Username: " + loginControl1.Username + "\nPassword: " + loginControl1.Password,"LoginControl");


/// }


/// %26lt;/code%26gt;


/// %26lt;/example%26gt;


public event System.EventHandler Ready;


private bool bCheck = true;


private bool bHash= true;


private string theUsername;


private string thePassword;


private string tmpU;


private string tmpP;


private string ErrMsg = "Please enter the correct Username / Password combination!";


private System.Windows.Forms.Button bLogin;


private System.Windows.Forms.Label lPassword;


private System.Windows.Forms.Label lUsername;


private System.Windows.Forms.TextBox tbPassword;


private System.Windows.Forms.Label lHeader;


private System.Windows.Forms.Label lText;


private System.Windows.Forms.PictureBox pbImage;


private System.Windows.Forms.TextBox tbUsername;


private System.Windows.Forms.Panel pHeader;


private System.Windows.Forms.ErrorProvider errorProvider;


/// %26lt;summary%26gt;


/// Required designer variable.


/// %26lt;/summary%26gt;


private System.ComponentModel.Container components = null;





/// %26lt;summary%26gt;


/// The public Initializer. Nothing happening here.


/// %26lt;/summary%26gt;


public LoginControl()


{


InitializeComponent();


}





/// %26lt;summary%26gt;


/// Clean up any resources being used.


/// %26lt;/summary%26gt;


protected override void Dispose( bool disposing )


{


if( disposing )


{


if(components != null)


{


components.Dispose();


}


}


base.Dispose( disposing );


}





#region Component Designer generated code


/// %26lt;summary%26gt;


/// Required method for Designer support - do not modify


/// the contents of this method with the code editor.


/// %26lt;/summary%26gt;


private void InitializeComponent()


{


System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(...


this.bLogin = new System.Windows.Forms.Button();


this.lPassword = new System.Windows.Forms.Label();


this.lUsername = new System.Windows.Forms.Label();


this.tbPassword = new System.Windows.Forms.TextBox();


this.pHeader = new System.Windows.Forms.Panel();


this.lHeader = new System.Windows.Forms.Label();


this.lText = new System.Windows.Forms.Label();


this.pbImage = new System.Windows.Forms.PictureBox();


this.tbUsername = new System.Windows.Forms.TextBox();


this.errorProvider = new System.Windows.Forms.ErrorProvider();


this.pHeader.SuspendLayout();


this.SuspendLayout();


//


// bLogin


//


this.bLogin.FlatStyle = System.Windows.Forms.FlatStyle.Popup;


this.bLogin.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.bLogin.Location = new System.Drawing.Point(330, 245);


this.bLogin.Name = "bLogin";


this.bLogin.Size = new System.Drawing.Size(70, 20);


this.bLogin.TabIndex = 9;


this.bLogin.Text = "Login";


this.bLogin.Click += new System.EventHandler(this.OnClickLogin);


//


// lPassword


//


this.lPassword.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.lPassword.Location = new System.Drawing.Point(30, 205);


this.lPassword.Name = "lPassword";


this.lPassword.Size = new System.Drawing.Size(80, 20);


this.lPassword.TabIndex = 11;


this.lPassword.Text = "Password";


this.lPassword.TextAlign = System.Drawing.ContentAlignment.MiddleRi...


//


// lUsername


//


this.lUsername.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.lUsername.Location = new System.Drawing.Point(30, 165);


this.lUsername.Name = "lUsername";


this.lUsername.Size = new System.Drawing.Size(80, 20);


this.lUsername.TabIndex = 10;


this.lUsername.Text = "Username";


this.lUsername.TextAlign = System.Drawing.ContentAlignment.MiddleRi...


//


// tbPassword


//


this.tbPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSi...


this.tbPassword.Location = new System.Drawing.Point(130, 205);


this.tbPassword.Name = "tbPassword";


this.tbPassword.Size = new System.Drawing.Size(270, 20);


this.tbPassword.TabIndex = 7;


this.tbPassword.Text = "";


//


// pHeader


//


this.pHeader.BackColor = System.Drawing.SystemColors.ActiveCaptio...


this.pHeader.Controls.AddRange(new System.Windows.Forms.Control[] {


this.lHeader,


this.lText,


this.pbImage});


this.pHeader.Dock = System.Windows.Forms.DockStyle.Top;


this.pHeader.Name = "pHeader";


this.pHeader.Size = new System.Drawing.Size(460, 60);


this.pHeader.TabIndex = 8;


//


// lHeader


//


this.lHeader.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.lHeader.Location = new System.Drawing.Point(10, 10);


this.lHeader.Name = "lHeader";


this.lHeader.Size = new System.Drawing.Size(360, 20);


this.lHeader.TabIndex = 3;


this.lHeader.Text = "Login";


this.lHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLe...


//


// lText


//


this.lText.Location = new System.Drawing.Point(20, 30);


this.lText.Name = "lText";


this.lText.Size = new System.Drawing.Size(360, 20);


this.lText.TabIndex = 4;


this.lText.Text = "Please enter your Username and Password.";


this.lText.TextAlign = System.Drawing.ContentAlignment.MiddleLe...


//


// pbImage


//


this.pbImage.Image = ((System.Drawing.Bitmap)(resources.GetOb...


this.pbImage.Location = new System.Drawing.Point(388, 5);


this.pbImage.Name = "pbImage";


this.pbImage.Size = new System.Drawing.Size(48, 48);


this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode....


this.pbImage.TabIndex = 5;


this.pbImage.TabStop = false;


//


// tbUsername


//


this.tbUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSi...


this.tbUsername.Location = new System.Drawing.Point(130, 165);


this.tbUsername.Name = "tbUsername";


this.tbUsername.Size = new System.Drawing.Size(270, 20);


this.tbUsername.TabIndex = 6;


this.tbUsername.Text = "";


//


// LoginControl


//


this.Controls.AddRange(new System.Windows.Forms.Control[] {


this.bLogin,


this.lPassword,


this.lUsername,


this.tbPassword,


this.pHeader,


this.tbUsername});


this.Name = "LoginControl";


this.Size = new System.Drawing.Size(460, 300);


this.Load += new System.EventHandler(this.OnLoad);


this.pHeader.ResumeLayout(false);


this.ResumeLayout(false);





}


#endregion





static void Main()


{


}





/// %26lt;summary%26gt;


/// OnLoad currently only defines the value tbPassword.PasswordChar.


/// %26lt;/summary%26gt;


private void OnLoad(object sender, System.EventArgs e)


{


tbPassword.PasswordChar = '\u25CF';


if (bCheck)


{


tmpU = theUsername;


tmpP = thePassword;


}


}





private void OnClickLogin(object sender, System.EventArgs e)


{


if (!bCheck)


{


if (!bHash)


{


theUsername = tbUsername.Text;


thePassword = tbPassword.Text;


if (Ready != null)


{


Ready(this, new System.EventArgs());


}


}


else


{


theUsername = HashString(tbUsername.Text);


thePassword = HashString(tbPassword.Text);


if (Ready != null)


{


Ready(this, new System.EventArgs());


}


}


}


else


{


bool b = CheckCredentials(tmpU, tmpP);


if (b)


{


if (Ready != null)


{


Successful(this, new System.EventArgs());


}


}


else


{


if (Ready != null)


{


Failed(this, new System.EventArgs());


}


}


}


}





/// %26lt;summary%26gt;


/// Public property defining the headline text.


/// %26lt;/summary%26gt;


public string labelHeadline


{


get


{


return lHeader.Text;


}


set


{


lHeader.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the header text.


/// %26lt;/summary%26gt;


public string labelHeader


{


get


{


return lText.Text;


}


set


{


lText.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the label text before the Username textbox.


/// %26lt;/summary%26gt;


public string labelUsername


{


get


{


return lUsername.Text;


}


set


{


lUsername.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the label text before the Password textbox.


/// %26lt;/summary%26gt;


public string labelPassword


{


get


{


return lPassword.Text;


}


set


{


lPassword.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the text on the login button.


/// %26lt;/summary%26gt;


public string labelButton


{


get


{


return bLogin.Text;


}


set


{


bLogin.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property to transfer the Username between the Host Application and LoginControl.


/// %26lt;/summary%26gt;


public string Username


{


get


{


return theUsername;


}


set


{


theUsername = value;


}





}





/// %26lt;summary%26gt;


/// Public property to transfer the Password between the Host Application and LoginControl.


/// %26lt;/summary%26gt;


public string Password


{


get


{


return thePassword;


}


set


{


thePassword = value;


}


}





/// %26lt;summary%26gt;


/// Property NoCheck. Defines if the validation of Username and Password is handled by the Host Application (True) or LoginControl (False).


/// %26lt;/summary%26gt;


public bool Check


{


get


{


return bCheck;


}


set


{


bCheck = value;


}


}





/// %26lt;summary%26gt;


/// Property NoHash. Defines if the user data is hashed (False).


/// %26lt;/summary%26gt;


public bool Hash


{


get


{


return bHash;


}


set


{


bHash= value;


}


}





/// %26lt;summary%26gt;


/// If NoCheck is set to false this method checks Username and Password.


/// %26lt;/summary%26gt;


private bool CheckCredentials(string usr, string pwd)


{


if (!bHash)


{


if (tbUsername.Text == usr)


{


if (tbPassword.Text == pwd)


{


return true;


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


else


{


if (HashString(tbUsername.Text) == HashString(usr))


{


if (HashString(tbPassword.Text) == HashString(pwd))


{


return true;


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


}





/// %26lt;summary%26gt;


/// If NoHash is set to false HashPassword ... well ... hashes the password.


/// %26lt;/summary%26gt;


private string HashString(string s)


{


UTF8Encoding UTF8 = new UTF8Encoding();


byte[] data = UTF8.GetBytes(s);


MD5 md5 = new MD5CryptoServiceProvider();


byte[] result = md5.ComputeHash(data);


return System.Text.Encoding.UTF8.GetString(resu...


}





/// %26lt;summary%26gt;


/// Error message for the ErrorProvider.


/// %26lt;/summary%26gt;


public string ErrorMessage


{


get


{


return ErrMsg;


}


set


{


ErrMsg = value;


}


}














}


}
Reply:uhhhh...yeah, what Panky said.


Good job Panky!


:D





Subhash,


Check out the Microsoft Knowledge Base, and the programming courses on Free-ed.net (they're free...)


Is there a difference between c++ and c++ .net ?????

if so what is the major difference?

Is there a difference between c++ and c++ .net ?????
There is a difference. Though the syntax is the same. C++ is a well defined standard OO language. C++ .net is a Microsoft variant that adheres to the standard but is managed in the sense that pointers and such aren't allowed. The context of the language is .Net so it is tied into the .Net framework via operating system hooks and libraries that are not in any C++ standards.
Reply:Yes, you can use C++ in visual studios. You can download Visual Studios for C++ or C#.

long stem roses

Multi Thread Application in C#.Net, example.?

Date: 5/1/2004 12:00:00 AM





C# .Net Tutorial Multithreading


Any Windows application must have one or more processes. A Process is structural unit with a memory block and using some set of resources. For each executable, the Windows operating system creates some isolated memory block. This C# .Net Tutorial tries to explain the basics of Multithreading in C# .Net.





Every process must have at least one thread. The first thread is created with a process and is known as primary thread. This Primary Thread is entry point of application. In traditional Windows applications it is the method WinMain() and in console applications it is named main().





Main goal of creating multithreading application is performance improvement. As an example, imagine a situation where in a user starts a long process (e.g. copying), he can?t use a single threaded application and wait for an infinite time for the operation to get completed. But if he uses multi?threading application he can set copying process in the background and interact with application without any problems.





At first, if one wants to create a multi-threaded application an important point to be remembered is, a global variable, which is being accessed by different threads, can try to modify the same variable. This is a generic problem, which is solved using a mechanism called Synchronization of threads. Synchronization is nothing but the process of creating some set of rules to operate data or resources.





The C# .Net language has a powerful namespace which can be used for programming with Threads as well as Thread Synchronization in C# .Net programming. The name of the namespace is Sytem.Threading. The most important class inside this namespace for manipulating the threads is the C# .Net class Thread. It can run other thread in our application process.





Sample program on C# Multithreading - C# Tutorial:


The example it creates an additional C# .Net class Launcher. It has only one method, which output countdown in the console.








--------------------------------------...





//Sample for C# tutorial on Multithreading using lock





public void Coundown()


{





lock(this)


{





for(int i=4;i%26gt;=0;i--)


{





Console.WriteLine("{0} seconds to start",i);





}





Console.WriteLine("GO!!!!!");





}





}








--------------------------------------...








There is a new keyword lock inside the above chunk of .Net C# tutorial code. This provides a mechanism for synchronizing the thread operation. It means at the same point of time only one thread can access to this method of created object. Unless the lock is released after completion of the code, the next routine or iteration cannot enter the block.





To understand it more clearly please have a look at the piece of main method?s code:








--------------------------------------...





Launcher la = new Launcher();





Thread firstThread = new Thread(new ThreadStart(la.Coundown));


Thread secondThread =new Thread(new ThreadStart(la.Coundown));


Thread thirdThread = new Thread(new ThreadStart(la.Coundown));





firstThread.Start();


secondThread.Start();


thirdThread.Start();








--------------------------------------...








As you see there were created three additional threads. These threads start a method of object that has Launcher type. The above program is a very simple example of using multi-threading in C#. Net. But C# .Net allows us to create more powerful applications with any level of complexity

Multi Thread Application in C#.Net, example.?
http://www.programmersheaven.com/article...





http://www.c-sharpcorner.com/Code/2002/N...
Reply:Threading is when u needed in multitasks, or when you want to go on long process...


Say a run batch query on database if i run it from the main Thread the program will stop respond till the end of the process by using threading you will be able to work with your program and also u may have a "Stop" button which change a static bool Variable, So if your thread check for this variable you could be able to stop the thread..





How to use it??


1- using System.Threading;





2-


private void Run()


{


//write your method code as u normally do..


}


Notes:


a) keep in your mind you can't path paramters no methods called by new thread so set some variable/property which you will need..





b) the run method above is an example you may call it whatever u want..





3-


public void Start()


{


Thread thread = new Thread(new ThreadStart(Run));


thread.Start();


}





that's it..





-There is also a class ThreadPool which have a default pool of 25 thread/processor which you can increase or dec.


-Don't use threading unless you need it and don't use soo many thread so it don't eat ur system resources.


good luck





Here is a good link describe it all


http://www.yoda.arachsys.com/csharp/thre...


What is the difference between C# and C#.NET?

C# is abstract programming language


C#.NET is C# working in .NET platform


e.g. C#.MONO works in .Mono platform on Linux


Hi, I've a problem with C#.NET MS visual studio.NET 2003 , any body can help? I'll appreciate that!!?

I want to access an Access database, try catch block gave me the error that "syntax error in INSERT INTO statement" while I'm sure that the syntax is true!! what is the problem I don't know!! I need to insert data into that database, plz help!! thx

Hi, I've a problem with C#.NET MS visual studio.NET 2003 , any body can help? I'll appreciate that!!?
The INSERT statement must be wrong then. If you are building the Query dynamically, then watch for spaces between the words.
Reply:End the statement with a semicolon
Reply:command = new OleDbCommand();


command.Connection = new OleDbConnection(Provider=Microsoft.Jet.O... Source=[databaseFilename]);


command.CommandText = "Insert into BOB set Name = hello;";


try


{


command.Connection.Open();


command.ExecuteNonQuery();


}


catch(OleDbException e)


{


throw new Exception(e.Message);


}


Finally


{


command.Connection.Close();


}


Login Form CodeNeeded for C# .Net 2005 with Database Ms Access 2003 or SQL?

HI friends





I am planning to build a Login Form ( Stand Alone Application). its part of my Project .





Here i had 2 Text Boxes Named Username TB and Password TB and a Login Button .


With MsAccess or Sql Server .. my Form has to Validate the data. I dont know How to validate the Username and Password in the Database. Once Validation Got done, Main Form Should Open.





I hope U understood my problem. I Donno How to Look into Database and compare the Username and Password ,the user Enters.





Thank You





Subhash.

Login Form CodeNeeded for C# .Net 2005 with Database Ms Access 2003 or SQL?
gimme ur mail id.





I have whole code but gimme ur mail id but id wnat to use this then u can.





using System;


using System.ComponentModel;


using System.Security.Cryptography;


using System.Text;


using System.Windows.Forms;





namespace pinky


{


/// %26lt;summary%26gt;


/// LoginControl is a free .NET login control with cryptography support.


/// %26lt;/summary%26gt;


public class LoginControl : System.Windows.Forms.UserControl


{


///%26lt;event cref="Successful"%26gt;


/// Raised after a successful Login.


/// %26lt;/event%26gt;


public event System.EventHandler Successful;


///%26lt;event cref="Failed"%26gt;


/// Raised after a failed Login.


/// %26lt;/event%26gt;


public event System.EventHandler Failed;


///%26lt;event cref="Ready"%26gt;


/// Raised after the User clicked on Login. Use this event to monitor LoginControl.


///%26lt;/event%26gt;


/// %26lt;example%26gt; This sample shows how to use Ready.


/// %26lt;code%26gt;


/// private void OnEventReady(object sender, System.EventArgs e)


/// {


/// MessageBox.Show("Username: " + loginControl1.Username + "\nPassword: " + loginControl1.Password,"LoginControl");


/// }


/// %26lt;/code%26gt;


/// %26lt;/example%26gt;


public event System.EventHandler Ready;


private bool bCheck = true;


private bool bHash= true;


private string theUsername;


private string thePassword;


private string tmpU;


private string tmpP;


private string ErrMsg = "Please enter the correct Username / Password combination!";


private System.Windows.Forms.Button bLogin;


private System.Windows.Forms.Label lPassword;


private System.Windows.Forms.Label lUsername;


private System.Windows.Forms.TextBox tbPassword;


private System.Windows.Forms.Label lHeader;


private System.Windows.Forms.Label lText;


private System.Windows.Forms.PictureBox pbImage;


private System.Windows.Forms.TextBox tbUsername;


private System.Windows.Forms.Panel pHeader;


private System.Windows.Forms.ErrorProvider errorProvider;


/// %26lt;summary%26gt;


/// Required designer variable.


/// %26lt;/summary%26gt;


private System.ComponentModel.Container components = null;





/// %26lt;summary%26gt;


/// The public Initializer. Nothing happening here.


/// %26lt;/summary%26gt;


public LoginControl()


{


InitializeComponent();


}





/// %26lt;summary%26gt;


/// Clean up any resources being used.


/// %26lt;/summary%26gt;


protected override void Dispose( bool disposing )


{


if( disposing )


{


if(components != null)


{


components.Dispose();


}


}


base.Dispose( disposing );


}





#region Component Designer generated code


/// %26lt;summary%26gt;


/// Required method for Designer support - do not modify


/// the contents of this method with the code editor.


/// %26lt;/summary%26gt;


private void InitializeComponent()


{


System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(...


this.bLogin = new System.Windows.Forms.Button();


this.lPassword = new System.Windows.Forms.Label();


this.lUsername = new System.Windows.Forms.Label();


this.tbPassword = new System.Windows.Forms.TextBox();


this.pHeader = new System.Windows.Forms.Panel();


this.lHeader = new System.Windows.Forms.Label();


this.lText = new System.Windows.Forms.Label();


this.pbImage = new System.Windows.Forms.PictureBox();


this.tbUsername = new System.Windows.Forms.TextBox();


this.errorProvider = new System.Windows.Forms.ErrorProvider();


this.pHeader.SuspendLayout();


this.SuspendLayout();


//


// bLogin


//


this.bLogin.FlatStyle = System.Windows.Forms.FlatStyle.Popup;


this.bLogin.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.bLogin.Location = new System.Drawing.Point(330, 245);


this.bLogin.Name = "bLogin";


this.bLogin.Size = new System.Drawing.Size(70, 20);


this.bLogin.TabIndex = 9;


this.bLogin.Text = "Login";


this.bLogin.Click += new System.EventHandler(this.OnClickLogin);


//


// lPassword


//


this.lPassword.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.lPassword.Location = new System.Drawing.Point(30, 205);


this.lPassword.Name = "lPassword";


this.lPassword.Size = new System.Drawing.Size(80, 20);


this.lPassword.TabIndex = 11;


this.lPassword.Text = "Password";


this.lPassword.TextAlign = System.Drawing.ContentAlignment.MiddleRi...


//


// lUsername


//


this.lUsername.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.lUsername.Location = new System.Drawing.Point(30, 165);


this.lUsername.Name = "lUsername";


this.lUsername.Size = new System.Drawing.Size(80, 20);


this.lUsername.TabIndex = 10;


this.lUsername.Text = "Username";


this.lUsername.TextAlign = System.Drawing.ContentAlignment.MiddleRi...


//


// tbPassword


//


this.tbPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSi...


this.tbPassword.Location = new System.Drawing.Point(130, 205);


this.tbPassword.Name = "tbPassword";


this.tbPassword.Size = new System.Drawing.Size(270, 20);


this.tbPassword.TabIndex = 7;


this.tbPassword.Text = "";


//


// pHeader


//


this.pHeader.BackColor = System.Drawing.SystemColors.ActiveCaptio...


this.pHeader.Controls.AddRange(new System.Windows.Forms.Control[] {


this.lHeader,


this.lText,


this.pbImage});


this.pHeader.Dock = System.Windows.Forms.DockStyle.Top;


this.pHeader.Name = "pHeader";


this.pHeader.Size = new System.Drawing.Size(460, 60);


this.pHeader.TabIndex = 8;


//


// lHeader


//


this.lHeader.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));


this.lHeader.Location = new System.Drawing.Point(10, 10);


this.lHeader.Name = "lHeader";


this.lHeader.Size = new System.Drawing.Size(360, 20);


this.lHeader.TabIndex = 3;


this.lHeader.Text = "Login";


this.lHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLe...


//


// lText


//


this.lText.Location = new System.Drawing.Point(20, 30);


this.lText.Name = "lText";


this.lText.Size = new System.Drawing.Size(360, 20);


this.lText.TabIndex = 4;


this.lText.Text = "Please enter your Username and Password.";


this.lText.TextAlign = System.Drawing.ContentAlignment.MiddleLe...


//


// pbImage


//


this.pbImage.Image = ((System.Drawing.Bitmap)(resources.GetOb...


this.pbImage.Location = new System.Drawing.Point(388, 5);


this.pbImage.Name = "pbImage";


this.pbImage.Size = new System.Drawing.Size(48, 48);


this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode....


this.pbImage.TabIndex = 5;


this.pbImage.TabStop = false;


//


// tbUsername


//


this.tbUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSi...


this.tbUsername.Location = new System.Drawing.Point(130, 165);


this.tbUsername.Name = "tbUsername";


this.tbUsername.Size = new System.Drawing.Size(270, 20);


this.tbUsername.TabIndex = 6;


this.tbUsername.Text = "";


//


// LoginControl


//


this.Controls.AddRange(new System.Windows.Forms.Control[] {


this.bLogin,


this.lPassword,


this.lUsername,


this.tbPassword,


this.pHeader,


this.tbUsername});


this.Name = "LoginControl";


this.Size = new System.Drawing.Size(460, 300);


this.Load += new System.EventHandler(this.OnLoad);


this.pHeader.ResumeLayout(false);


this.ResumeLayout(false);





}


#endregion





static void Main()


{


}





/// %26lt;summary%26gt;


/// OnLoad currently only defines the value tbPassword.PasswordChar.


/// %26lt;/summary%26gt;


private void OnLoad(object sender, System.EventArgs e)


{


tbPassword.PasswordChar = '\u25CF';


if (bCheck)


{


tmpU = theUsername;


tmpP = thePassword;


}


}





private void OnClickLogin(object sender, System.EventArgs e)


{


if (!bCheck)


{


if (!bHash)


{


theUsername = tbUsername.Text;


thePassword = tbPassword.Text;


if (Ready != null)


{


Ready(this, new System.EventArgs());


}


}


else


{


theUsername = HashString(tbUsername.Text);


thePassword = HashString(tbPassword.Text);


if (Ready != null)


{


Ready(this, new System.EventArgs());


}


}


}


else


{


bool b = CheckCredentials(tmpU, tmpP);


if (b)


{


if (Ready != null)


{


Successful(this, new System.EventArgs());


}


}


else


{


if (Ready != null)


{


Failed(this, new System.EventArgs());


}


}


}


}





/// %26lt;summary%26gt;


/// Public property defining the headline text.


/// %26lt;/summary%26gt;


public string labelHeadline


{


get


{


return lHeader.Text;


}


set


{


lHeader.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the header text.


/// %26lt;/summary%26gt;


public string labelHeader


{


get


{


return lText.Text;


}


set


{


lText.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the label text before the Username textbox.


/// %26lt;/summary%26gt;


public string labelUsername


{


get


{


return lUsername.Text;


}


set


{


lUsername.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the label text before the Password textbox.


/// %26lt;/summary%26gt;


public string labelPassword


{


get


{


return lPassword.Text;


}


set


{


lPassword.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property defining the text on the login button.


/// %26lt;/summary%26gt;


public string labelButton


{


get


{


return bLogin.Text;


}


set


{


bLogin.Text = value;


}


}





/// %26lt;summary%26gt;


/// Public property to transfer the Username between the Host Application and LoginControl.


/// %26lt;/summary%26gt;


public string Username


{


get


{


return theUsername;


}


set


{


theUsername = value;


}





}





/// %26lt;summary%26gt;


/// Public property to transfer the Password between the Host Application and LoginControl.


/// %26lt;/summary%26gt;


public string Password


{


get


{


return thePassword;


}


set


{


thePassword = value;


}


}





/// %26lt;summary%26gt;


/// Property NoCheck. Defines if the validation of Username and Password is handled by the Host Application (True) or LoginControl (False).


/// %26lt;/summary%26gt;


public bool Check


{


get


{


return bCheck;


}


set


{


bCheck = value;


}


}





/// %26lt;summary%26gt;


/// Property NoHash. Defines if the user data is hashed (False).


/// %26lt;/summary%26gt;


public bool Hash


{


get


{


return bHash;


}


set


{


bHash= value;


}


}





/// %26lt;summary%26gt;


/// If NoCheck is set to false this method checks Username and Password.


/// %26lt;/summary%26gt;


private bool CheckCredentials(string usr, string pwd)


{


if (!bHash)


{


if (tbUsername.Text == usr)


{


if (tbPassword.Text == pwd)


{


return true;


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


else


{


if (HashString(tbUsername.Text) == HashString(usr))


{


if (HashString(tbPassword.Text) == HashString(pwd))


{


return true;


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


else


{


errorProvider.SetError(bLogin, ErrMsg);


return false;


}


}


}





/// %26lt;summary%26gt;


/// If NoHash is set to false HashPassword ... well ... hashes the password.


/// %26lt;/summary%26gt;


private string HashString(string s)


{


UTF8Encoding UTF8 = new UTF8Encoding();


byte[] data = UTF8.GetBytes(s);


MD5 md5 = new MD5CryptoServiceProvider();


byte[] result = md5.ComputeHash(data);


return System.Text.Encoding.UTF8.GetString(resu...


}





/// %26lt;summary%26gt;


/// Error message for the ErrorProvider.


/// %26lt;/summary%26gt;


public string ErrorMessage


{


get


{


return ErrMsg;


}


set


{


ErrMsg = value;


}


}














}


}
Reply:uhhhh...yeah, what Panky said.


Good job Panky!


:D





Subhash,


Check out the Microsoft Knowledge Base, and the programming courses on Free-ed.net (they're free...)

gifts