|
hi,
you can Create Registry key for your application. within your registry key, you can set parameter for trial and registered version.
For more detail, visit Working with Windows Registry using VB.NET
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
modified on Saturday, March 29, 2008 7:15 AM
|
|
|
|
|
Hello Rupesh Kumar,
Thanks for replying.
I read the article that u send me and thanks for that, but as u said that within registry key u have to set parameter for trial and registerd version. So Can u explain me in detail that where i have to put the code of key creation and how it is checked for trial and registerd version???
u can send me sample code at my another email id: krishrana17@gmail.com
Thanks
Rana krishnraj
|
|
|
|
|
hi,
you put code for key creation at load event of application startup form. Follow step
1. first check whether registry key is created or not ?
2. if not, then create registry key and set some parameter like FirstUsedDate, lastUsedDate, VersionType etc.
3. if registry key is already created, then check firstUsedDate and add trial day to this date. now after adding days if validation period is over or current date is lower than the FirstUsedDate, then change version type to "trialexpired"
use above logic for trial .You can use some other logic
one more thing, by mistake i can copy wrong link in previous post but now this is correct. so read this link.
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
You are looking in the right direction, but what is stopping people from modifying the key manually using regedit and using the unrestricted version?
I reccommend that when you sell the full version, you sell it with a password (preferably one the client chooses). This can be stored on your database, and on the client's computer
|
|
|
|
|
hi,
generally i stored the value in encrypted form . so user can not modify the value. if user will try to modify these value, then application does not works (Because decrypt method does not produce proper value)
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Oh, right.
It's just that the way it was written made it look otherwise
|
|
|
|
|
Hello Rupesh Kumar,
Thanks again for replying.
as u said in the previous post, u send some link but i can't find any link in yr post.
so by mistake r u forgot to put the link here ??
Rana k.j.
|
|
|
|
|
|
Hello Rupesh Kumar,
I had done my thing using an example that u had sent me in prev. post and thanks again for your help.
and one more thing to ask to u that as u said to Farah sahad that if u encrypt yr key then its difficult to user to change that value. but here my question is that if i use SHA512 algo. to encrypt my value then how can i decrypt it? I mean is there any algo. for decrypt my value ?????
regards,
krishnraj
Rana k.j.
|
|
|
|
|
Don't use SHA512. SHA512 is a ONE WAY HASH algo, meaning that you can't "decrypt" it. You have to use an ENCRYPTION algo such as Triple DES or AES.
|
|
|
|
|
I have two reports, both are designed on same patern. But the problem is when we try to view the frist report its working fine and fetching the data based on conditions, where as other report is fetching the whole data from the database. I tried checking he SQL query in the mssql interface and the its returning the data according to the conditions, when i try to use same query in the cristal report in vb.net, its not returning the desired result.
I have attached the database schema and source code in the following location.
http://www.ourongoingprojects.com/sat/ReportProb.zip[^]
Sathyendra Vemulapalli
modified on Monday, March 31, 2008 3:16 AM
|
|
|
|
|
When I do a database insert there are no errors displayed, but when I check the database the data does not insert into the database.
Why?
Here is my code. I declared addRow globally.
addRow = lpDataSet.Tables("tbl_students").NewRow()
addRow("stud_cell") = txtStudCell.Text
addRow("stud_phone") = txtStudPhone.Text
lpDataSet.Tables("tbl_students").Rows.Add(addRow)
Try
studTableAdapter.Update(addRow)
Catch err As Exception
MessageBox.Show(err.Message)
End Try
|
|
|
|
|
Try this code
addRow = lpDataSet.Tables("tbl_students").NewRow() <br />
addRow("stud_cell") = txtStudCell.Text <br />
addRow("stud_phone") = txtStudPhone.Text <br />
lpDataSet.Tables("tbl_students").Rows.Add(addRow) <br />
<br />
Try <br />
studTableAdapter.Update() <br />
Catch err As Exception <br />
MessageBox.Show(err.Message) <br />
End Try
|
|
|
|
|
When I take the dataRow variable out of the table adapter update function I get the blue line.
The error says the following.
Overload resolution failed because no accesdsible update accepts this number of arguments.
Why wont the update update or add a row to the database with or without the dataRow variable as an argument?
|
|
|
|
|
Oops Sorry
addRow = lpDataSet.Tables("tbl_students").NewRow()
addRow("stud_cell") = txtStudCell.Text
addRow("stud_phone") = txtStudPhone.Text
lpDataSet.Tables("tbl_students").Rows.Add(addRow)
Try
studTableAdapter.Update(lpDataSet, "tbl_students" )
Catch err As Exception
MessageBox.Show(err.Message)
End Try
|
|
|
|
|
You can't put the name of a dataset coma the name of a table.
|
|
|
|
|
Maybe it needs AcceptChanges method for that table.
Sourie
|
|
|
|
|
I've spent most of the afternoon searching and looking at all kinds of encryption classes. I know that encryption can be a very detailed topic and it should be, but I'm just looking for something simple.
I want to take a text string 'The cat ate the mouse' and convert it to a SHA2 hex string that I can then store into a database.
Is there code to simply just do this? I've downloaded all kind of samples which have classes involved that are several pages of code. It's got to be simpler than this? Or of course then it might not be secure if it is too simple to encrypt / decrypt.
Any suggestions on something simple would be helpful?
Lost in the vast sea of .NET
|
|
|
|
|
You can use a function like the following:
Public Shared Function EncryptSHA512(ByVal strAs String) As String
Dim Bytes() As Byte
Dim Encoder As New System.Text.UTF8Encoding
Dim SHA512 As New System.Security.Cryptography.SHA512Managed
Dim SHA512String As String
Bytes = Encoder.GetBytes(str)
Bytes = SHA512.ComputeHash(Bytes)
SHA512String = Convert.ToBase64String(Bytes)
Return SHA512String
End Function
Alexei Rodriguez
|
|
|
|
|
This function is exactly what I was looking for. Currently I'm writing a test application that simply has a form and two buttons, encrypt and decrypt. The encrypt works great with this function, but when I try to write the decrypt function everything works, but I can't find logic to reverse the ComputeHash code?
Below is what I have:
Public Shared Function DecryptSHA512(ByVal str As String) As String<br />
Dim Bytes() As Byte<br />
Dim Encoder As New System.Text.UTF8Encoding<br />
Dim SHA512 As New System.Security.Cryptography.SHA512Managed<br />
Dim RegularString As String<br />
Bytes = Convert.FromBase64String(str)<br />
'Bytes = SHA512.??(Bytes) 'Can't find reverse logic<br />
RegularString = Encoder.GetString(Bytes)<br />
Return RegularString<br />
End Function
Thanks again for the code you have given and any suggestions on the decrypt logic is welcome
Lost in the vast sea of .NET
|
|
|
|
|
This can not be decrypted
Its a one way hashing algorithm
Alexei Rodriguez
|
|
|
|
|
SHA is not an encryption algorithm, it's a hashing algorithm.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have 2 phone number fields in the database that right now are a text dataType. They were an int, then I changed them to varchar(13). When I try to do an insert into the database there is an exception that says the following.
Failed to convert paramater value from a string to an Integer.
Here is my code. I declared addRow globally.
addRow = lpDataSet.Tables("tbl_students").NewRow()
addRow("stud_cell") = txtStudCell.Text
addRow("stud_phone") = txtStudPhone.Text
lpDataSet.Tables("tbl_students").Rows.Add(addRow)
Try
studTableAdapter.Update(addRow)
Catch err As Exception
MessageBox.Show(err.Message)
End Try
|
|
|
|
|
AAGTHosting wrote: Try studTableAdapter.Update(addRow)
Me thinks you didn't update the DataSet to change the datatype of the phone number field.
|
|
|
|
|
I checked the dataSet and it says the phone number field is text. Also, when I try to do an insert the info does not get inserted into the database.
|
|
|
|