|
Ok I tried to add this program to one of my programs but im getting this error
Error 13 Overload resolution failed because no accessible 'DateDiff' can be called without a narrowing conversion:
'Public Function DateDiff(Interval As String, Date1 As Object, Date2 As Object, [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday], [WeekOfYear As Microsoft.VisualBasic.FirstWeekOfYear = FirstWeekOfYear.Jan1]) As Long': Argument matching parameter 'Interval' narrows from 'Microsoft.VisualBasic.DateInterval' to 'String'.
'Public Function DateDiff(Interval As Microsoft.VisualBasic.DateInterval, Date1 As Date, Date2 As Date, [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday], [WeekOfYear As Microsoft.VisualBasic.FirstWeekOfYear = FirstWeekOfYear.Jan1]) As Long': Argument matching parameter 'Date1' narrows from 'String' to 'Date'.
on
Public Function DiffDate(ByVal OrigDay As String, ByVal OrigMonth As String, ByVal OrigYear As String)
Try
===[ Dim D1 = OrigDay & "/" & OrigMonth & "/" & OrigYear ]=== This is were the error takes me
Return DateDiff(DateInterval.Day, D1, DateTime.Now)
Catch
Return 0
End Try
End Function
how can i fix it?
modified on Saturday, May 31, 2008 7:26 PM
|
|
|
|
|
Swap around orig day & month: you use a different date system.
|
|
|
|
|
Error 17 Name 'board' is not declared. \Form1.vb 504 29
If EncryptU(board.GetMotherBoardID.Trim.ToString) = CompID Then
Error 24 Name 'board' is not declared. \register.vb 252 16
Function getMotherboardId()
Return board.GetMotherBoardID.Trim.ToString
End Function
Anyone know how to fix this?
Thanks for any help!
|
|
|
|
|
Ensure none of your resources are missing, the functions are provided by a library, it might not have imported correctly. If not, re-add it.
Tyler Menezes
www.TylerM.info
|
|
|
|
|
hi,
i am a beginner,i have a user registration form in which i used validation controls.it is working fine but without completely filling the form when i submit ,it should go to the error(Validation error) how to do it i dont have any idea please help.........
modified on Tuesday, April 8, 2008 6:01 AM
|
|
|
|
|
Hi look nice i just try it and i found the way around it easy way. Its just change system date a you done. Thats not realy safe is it? But otherway its nice designe. My advice is you should fix this bug !!! Example : may you can try make reg key in registry as date when this program was installed
Thank you for that anyway ...
|
|
|
|
|
I used the code successfully in VS2005 with .NET 2.0. Now that I've moved on to .NET 3.5 and VS 2008, I'm getting numerous errors. Is there an updated version for .NET 3.5? I've handled most of the errors, but can't seem to get around this one in Encryption.vb. _crypto.Key = _key.Bytes ="Specified key is not a valid size for this algorithm."
Private Sub ValidateKeyAndIv(ByVal isEncrypting As Boolean)
If _key.IsEmpty Then
If isEncrypting Then
_key = RandomKey()
Else
Throw New CryptographicException("No key was provided for the decryption operation!")
End If
End If
If _iv.IsEmpty Then
If isEncrypting Then
_iv = RandomInitializationVector()
Else
Throw New CryptographicException("No initialization vector was provided for the decryption operation!")
End If
End If
_crypto.Key = _key.Bytes
_crypto.IV = _iv.Bytes
End Sub
System.Security.Cryptography.CryptographicException was unhandled
Message="Specified key is not a valid size for this algorithm."
Source="mscorlib"
Any help will be appreciated.
|
|
|
|
|
I'm having the same problem.
Can't get it to work with VB.NET 2008 and FW 3.5.
Any help would be appreciated please.
Rens
|
|
|
|
|
I'll update it soon, I have other projects which need to be completed first. If anyone else has a solution in the mean time, feel free to post it.
Tyler Menezes
www.TylerM.info
|
|
|
|
|
Hi.
I haven't looked much at the source code yet, but as I did, I didn't find a way to reset the timer.
When I first launched the example, it said I had 30 days left. I then clicked: Continue Unregistered, and the popup box with the "Were this not a demonstration, blah blah...", and I clicked OK... Then I launched it again, and this time I did not have 30 days, left, but three hundred and something, while it told me the system clock had been changed -.-
Is this a bug? (I'm on Vista)
MulleDK13 (http://www.splintercell3.treesoft.dk)
|
|
|
|
|
Wait.. I get it...
Public RegSubKeyName As String = "HardToGuessNameHere1"
But still... it's only working the first time..
"You have 30 days remaining"
and next time
"You have 323 days remaining", and the "system clock changed" warning -.-
OH! Might have something to do with the "UK dates" reply... Guess it's the same as Denmark... I'll try
YEP! That fixed it
So, what if someone downloads my program, and doesn't live in Europe? Then they have a single run, before the trial period expires -.-
MulleDK13 (http://www.splintercell3.treesoft.dk)
modified on Tuesday, February 12, 2008 12:54 PM
|
|
|
|
|
Hi,
I'm having trouble with just getting the program to run. I've changed dates to the UK format.
Now i'm getting the warning that I have changed the system date.
I am a retired pensioner with an interest in VB, I am currently using Vista and Visual Studio 2008
I could really use a great deal of help in how to set up the program, what changes need to be changed and what to do now that the web site for registering the program no longer seems to exist.
I'm asking a lot of you I know, but I do hope you can help as it appears that Tyler is tied up with two or three projects at the moment.
Yours fraternaly
Ken
|
|
|
|
|
This program is really useful, thanks, but there is a problem when used on computers in the UK. I thought I'd post a fix for anyone with the same problem. The problem is that the program will fail for computers using the UK date system (DD/MM/YYYY rather than MM/DD/YYYY) but this can be easily fixed with a couple of minor changes:
The following code is in the Form1_Load class:
Dim OldDate As String = OldMonth & "/" & OldDay & "/" & OldYear
If DateTime.Now.Compare(DateTime.Now, OldDate) < 0 Then
unregbutton.Enabled = False
InTrial = False
oReg = Registry.LocalMachine.OpenSubKey("Software", True)
oReg = oReg.CreateSubKey(RegSubKeyName)
oReg.SetValue("Enable", "1")
oReg.Close()
End If
Must be changed to:
Dim OldDate As String = OldDay & "/" & OldMonth & "/" & OldYear
If DateTime.Now.Compare(DateTime.Now, OldDate) < 0 Then
unregbutton.Enabled = False
InTrial = False
oReg = Registry.LocalMachine.OpenSubKey("Software", True)
oReg = oReg.CreateSubKey(RegSubKeyName)
oReg.SetValue("Enable", "1")
oReg.Close()
End If
Will also need to change the function DiffDate:
Public Function DiffDate(ByVal OrigDay As String, ByVal OrigMonth As String, ByVal OrigYear As String)
Try
Dim D1 = OrigMonth & "/" & OrigDay & "/" & OrigYear
Return DateDiff(DateInterval.Day, D1, DateTime.Now)
Catch
Return 0
End Try
End Function
to
Public Function DiffDate(ByVal OrigDay As String, ByVal OrigMonth As String, ByVal OrigYear As String)
Try
Dim D1 = OrigDay & "/" & OrigMonth & "/" & OrigYear
Return DateDiff(DateInterval.Day, D1, DateTime.Now)
Catch
Return 0
End Try
End Function
There may be other instances I haven't found yet which also need to be changed but I think thats it. Unfortunately this will only work for UK system environments now, I'm sure it would be possible to change this to be more generic by checking the local system to see which format should be used, but I can't be bothered.
|
|
|
|
|
Sorry, just noticed what I posted's been asked already in a different post, should have checked more thoroughly before posting!
|
|
|
|
|
I tried to change platform to .Net Compact plateform but some functions are not supported.
Is it possible to change to mobile platform?
|
|
|
|
|
In order to port to a compact platform you'd probably be able to reuse some of the code base, but would need to rewrite some functions. The GUI would also need to be redone. Unfortunately I have no experience with mobile device applications, so I'm not sure what help I can be. If you tell me what functions are unsupported I may be able to rewrite code to avoid them.
Tyler Menezes
www.TylerM.info
|
|
|
|
|
Let me start by saying this is a great program. I installed it in my app, built the app, installed it and it was working fine. When I tried to update the app(my application) if found that it didn't want to update. I deleted the installed version and tried to reinstall and received a message that their was an error. The details explained that the HardwareMotherboardID.dll already existed which is what is causeing the error. I've tried leaving this out of the build, with no luck...does anyone have any suggestions? FYI below is the error I'm getting...
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\MyApp\MyApp.application resulted in exception. Following failure messages were detected:
+ Downloading file:///C:/MyApp/MyApp_1_0_0_6/HardwareMotherboardID.dll.deploy did not succeed.
+ The file 'C:\Documents and Settings\me\Local Settings\Temp\Deployment\RW8HN9KH.0AV\62D1L2EE.574\HardwareMotherboardID.dll' already exists.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [7/10/2007 9:37:20 AM] : Activation of C:\MyApp\MyApp.application has started.
* [7/10/2007 9:37:20 AM] : Processing of deployment manifest has successfully completed.
* [7/10/2007 9:37:20 AM] : Installation of the application has started.
* [7/10/2007 9:37:21 AM] : Processing of application manifest has successfully completed.
* [7/10/2007 9:37:23 AM] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [7/10/2007 9:37:23 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading file:///C:/MyApp/MyApp_1_0_0_6/HardwareMotherboardID.dll.deploy did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.IO.IOException
- The file 'C:\Documents and Settings\me\Local Settings\Temp\Deployment\RW8HN9KH.0AV\62D1L2EE.574\HardwareMotherboardID.dll' already exists.
- Source: mscorlib
- Stack trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
Thanks!
|
|
|
|
|
A little more info (I do not understand .dll's at all so this is a learning experience) If I delete the HardwareMotherboardID.dll from my project it installs fine...Do I have to make two download sites one for a new users and one for users just updating or am I handleing the .dll file wrong?
|
|
|
|
|
Try having your updating installer (or however you're patching your program) delete this file. If you're using the default VB one, have your users uninstall their old version first (the uninstaller shouldn't erase the registration registry entries, so your users shouldn't have any problems - do test first, though).
What I'd recommend, however, is that you include an auto-update feature inside your app which downloads and replaces your app with an updated version. There are some fantastic articles here on CP about creating this feature, and it would probably make your life and the user's lifes easier.
-Tyler
(PS: May I ask what your app does? I'm interested to know what my registration code is being used for )
Tyler Menezes
www.TylerM.info
|
|
|
|
|
Once the program is registered, I have noticed that the form "form1" still opens then immediately goes away. I prefer this form not even show up if the program is registered. Is there a way for this to happen?
Thanks a ton!
Ron
|
|
|
|
|
Yes, you need to have your program launch at start, use the registration checking to see if the user is registered, and pass the user on to the registration form if not. It's about 30 minutes of modifications, I'd guess.
Also, removing some of the graphics and using simple text makes it almost unnoticable, but it's not as nice looking.
Tyler Menezes
www.TylerM.info
|
|
|
|
|
hello
thank you from your code but i need the C# code
if maybe
|
|
|
|
|
This is VB.NET. There is no C# code.
Tyler Menezes
www.TylerM.info
|
|
|
|
|
Hi Tyler,
first let me thank you for your efforts to create this nice piece of code.
I want to use your registration form within my c# application. So far I had no luck in moving your VB forms into my code. So I thought about convertig your code into C#.
Do you think this is possible from a technical view, and even more important, do you allow that I convert your code to C# and use it in my app? Of course I will keep your Usage Restrictions and copyrights.
Thanks
Dirk
|
|
|
|
|
From a technical point of view, I see no reason why it shouldn't be possible to convert it to C#.
And of course I'd allow it to be converted to C#. If you do convert it, I'd actually be appriciative if you would allow me to upload it. Of course I'd give you credit. In either case, you can change the copyright text to something more like:
'Original code in VB.NET by Tyler Menezes<br />
'Converted to C# by Dirk
Let me know as to the status of this,
Tyler Menezes
|
|
|
|
|