Question limiting sends within form

asmDash

New member
Joined
Dec 14, 2011
Messages
3
Programming Experience
1-3
i got a program that has clients send self typed messages via gmail and i want to be able to limit everyones use of this so they dont try to spam me, i want to make it so they can only send 1 from their computer every 12 hours how would i do this?

also i would like to make sure that one of the boxes they fill in has indeed been filled in with at least 20 characters before they can click the send button, hoping this would prevent ppl from sending blank messages

thanks in advance
 
You can check TextLength property, for example you can use TextChanged event and toogle Enabled for the send button based on limit is reached.
About time limit, for example add a Date user setting to application settings. This can be used to store and compare Date.Now value.
 
ok i got the date checker working but when i have it to create/overwrite the date file i used
VB.NET:
        Dim ioFile2 As New FileStream("C:\windows\ihdate.txt", FileMode.OpenOrCreate, FileAccess.Write)
        Dim ioLine2 As Date = Date.Today
        ioFile2.Write(ioLine2)

but over the last line it keeps saying "error BC30516: Overload resolution failed because no accessible 'Write' accepts this number of arguments."

help? plz and thanks
 
Last edited:
but over the last line it keeps saying "error BC30516: Overload resolution failed because no accessible 'Write' accepts this number of arguments."
That is not really surprising feedback. Everything VB and .Net is documented, intellisense and MSDN are your best coding friends.
Why would you not use an application setting? much easier.

You can use a StreamWriter in place of FileStream. FileStream is more low level. You can also simpler write text content using WriteAllText method of System.IO.File class or same method by using My.Computer.FileSystem object.
 
Back
Top