|
Encryption is a class save it as a class file under your project and then you can call teh class inside your code. I didn't get any error, it is working perfectly.
What is the error message?
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi i am new in this...,
plz explain some what depth....
Magi
|
|
|
|
|
Under the solution explorer go over the project name and then press right mouse button and select Add then Select class. A window will popup and name the class file as Encryption.vb. Copy the code and paste it inside the class file. There are two things only you have to play with it. These are:
Const ENCRYPT_KEY As String = "DRUMSSHOW"
Const ENCRYPT_VECTOR As String = "CODEPRJT"
You can encyrpt any string with your own key and vector value. You can change this. That is how any string get encrypted and decrypted with your given values as key and vetor value.
Imports System.Text
Imports System.Security.Cryptography
should be on top of the class file put these above Public Class Encryption section. Your class files becomes ready to use. Now you can encrypt and depcrypt any string as follows. This sample below is used out of class file in somewhere in your code.
Dim ShowString as String = "Put any text here"
Messagebox.Show(Encryption.toBase64(ShowString))
Messagebox.show(Encryption.toBase32(ShowString))
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi i used one class file(Encryption)..,
in that i told...
Const ENCRYPT_KEY As String = "TEST"
Const ENCRYPT_VECTOR As String = "CODEPRJT" these codes
and that two functions(ToBase64,ToBase32),
Then in my EncryptionDecrytion.aspx form...,
i given..."Dim MyEncryption As Encryption"
and one string...,
While runtime i am getting..,
Specified key is a known weak key for TripleDES And cannot be used..,
i dont know whats the error mean..........,
Plz solve my probs,
Magi
|
|
|
|
|
OKat it means it is working but it doesn't like the KEY or Vector values. Therefore try this or samething else
Const ENCRYPT_KEY As String = "DRUMSSHOW"
Const ENCRYPT_VECTOR As String = "CODEPRJT"
Don't forget that you can use your own key and vector values. But encryption sometimes doesn't like the values you want to use. Therefore, you should play with these values to make it running.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
actually whats the need to assign some strings in that two things(ENCRYPT_KEY ,ENCRYPT_VECTOR )
Magi
|
|
|
|
|
after assign some other string in that..,
i am getting "Invalid Character in a base-64 string"..,
this error is coming on that function tobase32(inside)...,
Magi
|
|
|
|
|
It means taht whatever you are trying decrypt has invalid chars. If you are not getting any error message while you encrypt a string that means you shouldn't get any error message when decrypt it. Check the strings and make sure you don't have any invalid chars. ToBase32 is used to decrypt a string. ToBase64 is used to encrypt a string. Therefore, becareful that both functions use the same variable not a diffeent ones.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
i checked encrption, its working..,
but decryption is creating probs...,
invalid char means?,i assign proper string only..,
And i paste ur codes exactly on that place...,
then what else?, i checked both function..,
both place coming same variable names only
Magi
|
|
|
|
|
please copy and paste your code here and let me check it for you. I do not need encrytpion class file but your code where you use it. It suppose to work because it is working in my puter.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
in my aspx form back code i given this much only......,
Dim MyEncryption As Encryption
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = MyEncryption.ToBase64(EStr)
Label2.Text = MyEncryption.ToBase32(EStr)
End Sub
Magi
|
|
|
|
|
Your code seems okay you shouldn't get any errors.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
|
i need it in vb.net...
Magi
|
|
|
|
|
hello all, i have an application, in which there is a butoon, on clicking it, an existing word document must open in msword, so i've tried to reference the library from the references (the COM tab) , but i couldnt find it, am using office 2003.
Any help....
Scorpion
|
|
|
|
|
system.diagnostics.process.start(" Location of the word document and then the name of the document .doc")
Example:
If the word document was in C:\ drive, and was called Example.doc, then:
You put this code in the button:
system.diagnostics.process.start("C:\Example.doc")
and it would open the word document.
|
|
|
|
|
Thanks, it worked great.
One inquiry, do i have to close the process? or end it ? or shut it down? oe may be it ends by closing the MsWord automatically?
Scorpion
|
|
|
|
|
scorp_scorp wrote: One inquiry, do i have to close the process? or end it ? or shut it down? oe may be it ends by closing the MsWord automatically?
No only when you want it to close. It is launched the same way as when you double click on it in windows.
To close it just hit the close button in the top righthand corner in msword and the .doc would close or click file then exit.
Or if you want to close it programmatically you could use the process.closemainwindow or process.kill.
You can do this by going to toolbox then clicking components and then double click on process to add a process component to the form.
Then this is the code you should have in your first button:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Process1.StartInfo.FileName = "C:\Example.doc"<br />
Process1.Start() '//starts example.doc<br />
End Sub
And this is the code for your second button(create another button) to close example.doc:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
Process1.StartInfo.FileName = "C:\example.doc"<br />
Process1.CloseMainWindow() '//Sends the example.doc a close message asking it to terminate<br />
'
'// And this will force example.doc to close <br />
<br />
End Sub
Hope this helps
|
|
|
|
|
Thanks a lot A*****, it was great, worked fine.
Regards.
Scorpion.
|
|
|
|
|
I've populated my DataGridView in which first column in a checkbox(System.Boolean) column. I want to select rows if a checkbox cell is clicked causes the Checkbox.Checked to true.
Private Sub gd1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles gd1.CellClick
If e.ColumnIndex = 0 Then
Me.gdFeePlan.Rows(e.RowIndex).Selected = Me.gd1.CurrentCell.Value
End If
End Sub
gd1 is the DataGridView
and column(0) is checkboxcolumn
Above code doen't works. When I select a row in Grid. I want to select all rows which holds first Checkbox Column Checked to true.
Can you help me?
|
|
|
|
|
Can i write a vb 6.0 client for a webservice, if yes can anyone provide me with any links for that.
Thanks in advance.
----------------------------------
where there is a will there is a way
|
|
|
|
|
When it's loaded I can't really do anything with it. I'm trying to register this copy and when I goto Help/About, nothing comes up. Same thing happens with New Project and any other file menu. Anyone know whats going on?
|
|
|
|
|
Hai,
How can I split a "SINGLE TIFF IMAGE FILE TO MULTI TIFF IMAGE FILE" using vb.net 2003 or vb.net 2005.
Regards,
G.Manivannan M.Sc.,[IT],
Software Programmer (VBA),
AKUVA Infotech, Bangalore.
|
|
|
|
|
|
Hai,
Thanks for your Help.
Regards,
G.Manivannan M.Sc.,[IT],
Software Programmer (VBA),
AKUVA Infotech, Bangalore.
|
|
|
|