|
I have seen clr type used instead of c# type.for eg:-
int n1 = 6;
Single n2 = 14.3;
double n3;
So my question is using clr type always ,does improve speed ,saves time?Then why do we use c# types?May I know the advantages/disadvantages if any for using clr type in lieu of c# type?
|
|
|
|
|
There is no difference in performance between using the C# aliases or the CLR types, as they are not separate types. The int keyword for example is an alias for the System.Int32 type, so when you specify int , you are actually using the CLR type.
With a few rare exceptions there is absolutely no difference which you use. One of the exceptions are when you specify the underlying type for an enum:
enum test1 : int { Hello, There }
enum test2 : System.Int32 { Hello, There }
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi there
I am developing a windows application that will store passwords , credit card number and other sensitive information on the computer. Definetilely it will be stored in the file.
There are algorithms in System.Security.Cryptography TripleDes,RSACryptoServiceProvider etc etc.
Encrypting the file using above algorithms will require
private key(in case of asymmetric encryption) or
secret key and Intialization Vector(In case of symmetric encryption)
I have encrypted the data using the above key and is working fine.Now the challenge is where to store the Private Key so that i can retrive that key later to decrpyt the data and show to the user.
Please guide any reading material or code will be of help
Thanks
THE SK(Sandeep Kalra)
I am the One
|
|
|
|
|
Use Hashing algorithm for this purpose, because Hashing Algorithms are one way and no need to decrypt.
|
|
|
|
|
Sandeep Kalra wrote: Now the challenge is where to store the Private Key so that i can retrive that key later to decrpyt the data and show to the user.
You can probably encrypt the private key with something known as a master key. And then when needed, you can decrypt the key with the master key. There may be better techniques, but this is one i heard of.
EDIT: A master key can be a simple password (which is to be stored in your brain )
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
hi all,
I have static class where is a CompileRooms() method . Which is as :
public static void CompileRooms()
{
try
{
frmTimetablePopup objfrmTimetablePopup = (frmTimetablePopup)Application.OpenForms["frmTimetablePopup"];
DataGridView grd = new DataGridView();
grd.Location = new Point(310, 200);
grd.Size = new System.Drawing.Size(300, 200);
DataGridViewTextBoxColumn grdCol = new DataGridViewTextBoxColumn();
grdCol.HeaderText = "Days";
grdCol.Name = "Col1";
grdCol.Width = 50;
grdCol.DefaultCellStyle.BackColor = Color.CornflowerBlue;
grd.Columns.Add(grdCol);
objfrmTimetablePopup.Controls.Add(grd);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
but an error occur :"Object reference not set to an instance of an object."
problems is here ->objfrmTimetablePopup.Controls.Add(grd);
|
|
|
|
|
Hi zeeShan anSari,
when create object you have to use new key word.
like :
frmTimetablePopup objfrmTimetablePopup = new (frmTimetablePopup)Application.OpenForms["frmTimetablePopup"];
Check it out.
Pavan Pareta
|
|
|
|
|
frmTimetablePopup objfrmTimetablePopup = new (frmTimetablePopup)Application.OpenForms["frmTimetablePopup"]; this code also create syntax error
|
|
|
|
|
Hye zeeShan anSari.
you need to show Error and code for Application.OpenForms[""];
what is OpenForms ?
Pavan Pareta
|
|
|
|
|
I am quite new to c# ..I want to create a contact form...
I created the front end design
which contains...
one text field to write comment and two buttons
SUBMIT and RESET.....
How to write code for SUBMIT and RESET buttons such that on clicking SUBMIT button the comment must be sent to an e-mail id and on clicking
RESET button the text field must be set empty..
|
|
|
|
|
In order to send e-mail you can use system.net.mail class. For resetting fields just set text to ""
|
|
|
|
|
it is very better if you use ASP.NET Server controls like Button, its very better than asp controls
Human knowledge belongs to the world
|
|
|
|
|
This question has probably been asked a million times here but I'll be danged if I can't find any answers to this.
I am trying to write a couple of methods that I can pass any custom class or collection into and using reflection it will pull out the properties of the class and format things out into a report. I've got the method for handling an individual class. What I'm having trouble with is the collection. Does anybody know of how to take a custom collection and use reflection to pull out each individual item from the collection? Once I have the item, I will pass it into my other method for pulling out the properties. Most of the collections I will be dealing with are derived from List<t>. Could the collection method accept an object array (Object[]) without any conversion issues or should it accept the collection as a single Object?
My mind is like an aluminum trap. Some things get caught in the trap, and some things bend the trap and get away.
|
|
|
|
|
Sounds to me like you would want to have the method take IEnumerable<T>
|
|
|
|
|
I have this error , but my file is not a read-only, it is writtable ? How to solve it?
Thanks
|
|
|
|
|
Some other process will be using this file. Try to end the process which is using this file.
|
|
|
|
|
The error means some other process is using the file. It does not matter if it is not read-only.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
what is New Text Document.xsl ? I found out that i could not see my xml file if i don't put that xsl file in the same folder with my xml file ?Why?
Thanks
|
|
|
|
|
actually .xsl is schema file file for .xml files.Generally, the problem doesn't occur.Elaborate it little more.
Cheers!!
Brij
|
|
|
|
|
If i remove xls file form the same folder with xml file. When i open my xml file, this will appear:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
The system cannot locate the resource specified.
|
|
|
|
|
Do you mean that you could not see the xml file in the file listing, or are you using some program to display the content of the xml file that requires the xsl file?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i don't know. That's why i ask why we need xsl file in the same folder with xml file in order to view the xml file?
|
|
|
|
|
hung1984 wrote: i don't know.
You don't know what you mean?
hung1984 wrote: That's why i ask why we need xsl file in the same folder with xml file in order to view the xml file?
Well, that answers part of my question, as the problem obviously is with viewing the content of the file. What program are you using to view the content of file?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i have a problem with my c# project..
im using a listview grid in generating my database. and my problem is that it won't increment the number.. can anyone help me?? plss
|
|
|
|
|
There are a number of things wrong with this post
Your title should be relevant to the content of your problem
A listview cannot "generate" your database
Do you mean a listview or a datagridview there is no such control as a listview grid. The behaviour of these 2 controls is radically different.
Your question does not make any sense, probably because your understanding of your problem is too limited to allow you to state it in terms we can understand.
Define the control
define the method of populating the control from the database
define the problem you are facing in more detail
Never underestimate the power of human stupidity
RAH
|
|
|
|