|
I'm not sure what you want us to help you with. When you get the message "Recipient unknown", it's telling you that the email address you're trying to send the email to doesn't exist or that there's a problem with the recipient configuration that prevents you getting access to them. As this is a problem, effectively, at their end there's not a lot you can do.
|
|
|
|
|
My problem is only that some users are not receiving emails because for them its showing error(Recipient unknown)and rest are receiving the emails.
Is there is any way that they also start getting the emails.
|
|
|
|
|
Go and ask them to check. The only thing you can do is to ask them to verify their email address.
Veni, vidi, abiit domum
|
|
|
|
|
Guys I have made a convertor that converts a decimal number to a octal number in VB.NET,but it converts only upto 7 digits of decimal number to Octal.If it exceeds 7 digits "Memory Overflow" message is displayed.How To solve this problem guys?
Here Is The Code:
Dim s1,s2 As string
Dim i1,i2 As Integer
s1=textbox1.Text
i1=Convert.ToInt64(s1, 10)
s2=Convert.ToString(i1, 8)
i2=Convert.ToInt64(s2, 8)
but this code is limited only up to 7 characters of input.
modified 24-Sep-13 11:01am.
|
|
|
|
|
Well look at these two lines:
Dim i1, i2 As Integer
i1 = Convert.ToInt64(s1, 10)
What is happening here is that you are sticking an Int64 into an Integer. It can handle a certain number of "characters" (actually numbers) because after that number it overflows. You need to declare i1 and i2 as something that can hold large numbers, something like maybe Int64... Integer is an Int32 by default.
|
|
|
|
|
Any Other Solutions Or Suggestions,To solve this problem.....
|
|
|
|
|
Why? Did you try what I said and it did not work?
|
|
|
|
|
S you are right,i have changed it from "ToInt64" to "ToDouble"
but,it is converting now upto 9 characters only...........
|
|
|
|
|
Please post the code you changed like you did in the first post.
|
|
|
|
|
Here Is The code:-
Dim s1,s2 As string
Dim i1,i2 As Integer
s1=textbox1.Text
i1=Convert.Todouble(s1)
s2=Convert.ToString(i1, 8)
i2=Convert.Todouble(s2)
but It is limited only up to 9 characters.....
|
|
|
|
|
This is exactly the same problem...
Double is 64 bit, integer is 32 bit. You need to declare i1 and i2 as double's if you want to use ToDouble.
|
|
|
|
|
So here I am again. Something that should be easy is not.
I created a usercontrol (button_fancy). It works and all, but in the designer after I add my usercontrol, If I dbl click it generates a load event, All other controls generate a click event by default.
Of course I can just single click it and go to the event properties and create a click event. But how do I get the designer to default the click event?
Bonus question,
In the control I have a propery "mytext" I wanted to be consistant and have a property "Text". However that does not work. What little trick does it take to override a unexposed property?
Highflier
|
|
|
|
|
It is easy. It just doesn't work the way you think it should.
Double-clicking anything in a UserControl should generate a Load event header in the host form code, not a Click. This is because the UserControl, reguardless of what you put in it, IS the single control exposed to the host you drop it on. A UserControl is a container for other controls that have a related purpose, acting as a single control and, as such, should NOT expose this constituent controls to the host.
UserControls do not generate the Click event by default because they are not expected to be clicked on as a single control, like a button.
having said all that, it's very easy to change. In the UserControls code, at the top of the class where you inherit from UserControl, you simply add the DefaultEvent attribute to the class declaration, like this:
<DefaultEvent("Click")>
Public Class MyControl
Inherits UserControl
|
|
|
|
|
Thanks. However I needed [DefaultEvent("Click")]
It only took me about 10 seconds to figure that out after your post.
My life will be a lot easier now
Highflier
|
|
|
|
|
The code I posted was for VB.NET. You're using C#, which replaces the angle brackets with square ones.
|
|
|
|
|
Hi everybody,
my application runs on WinCE 5 device, it communicates with a PLC via modbus/TCP and it integrates a web server (code found in the article "Create your own Web Server using C#").
I'm trying to manage the remote access (from web browser) with user authentication and session timeout.
Every user is an object of the following class:
Public Class CWebUser
Private mUserName As String = ""
Private mPassword As String = ""
Private mIP As String = ""
Private mStartSession As Long = 0
Private mLogged As Boolean = False
Private WithEvents mWUTimer As System.Windows.Forms.Timer
Sub New()
mWUTimer = New System.Windows.Forms.Timer()
mWUTimer.Enabled = False
mWUTimer.Interval = 10000
AddHandler (mWUTimer.Tick), AddressOf WUTimer_Tick
End Sub
Private Sub WUTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
If ((DateTime.Now.Ticks - mStartSession) > (CGlobali.WebSessionDuration * 10000000)) Then
mWUTimer.Enabled = False
mIP = ""
mLogged = False
End If
End Sub
Public Property UserName() As String
Get
Return mUserName
End Get
Set(ByVal value As String)
mUserName = value
End Set
End Property
Public Property Password() As String
Get
Return mPassword
End Get
Set(ByVal value As String)
mPassword = value
End Set
End Property
Public Property IP() As String
Get
Return mIP
End Get
Set(ByVal value As String)
mIP = value
End Set
End Property
Public Property StartSession() As Long
Get
Return mStartSession
End Get
Set(ByVal value As Long)
mStartSession = value
End Set
End Property
Public Property Logged() As Boolean
Get
Return mLogged
End Get
Set(ByVal value As Boolean)
mLogged = value
End Set
End Property
Public Property WUTimer() As System.Windows.Forms.Timer
Get
Return mWUTimer
End Get
Set(ByVal value As System.Windows.Forms.Timer)
mWUTimer = value
End Set
End Property
End Class
When the application starts, it creates a list of authorized users.
When someone logs in, if UserName and Password are OK, I call the following sub:
Private Sub SetWUser(ByVal Name As String, ByVal IP As String)
Dim i As Int32
For i = 0 To (CGlobali.Users.Count - 1)
If (Name = CType(CGlobali.Users.Item(i), CWebUser).UserName) Then
CType(CGlobali.Users.Item(i), CWebUser).IP = IP
CType(CGlobali.Users.Item(i), CWebUser).Logged = True
CType(CGlobali.Users.Item(i), CWebUser).StartSession = DateTime.Now.Ticks
CType(CGlobali.Users.Item(i), CWebUser).WUTimer.Enabled = True
Exit Sub
End If
Next
End Sub
This sub should start the timer WUTimer of the specified user, and indeed the property WUTimer.Enabled is set to True, but the sub WUTimer_Tick is never executed as if it is not connected to the Tick event of the timer.
Can some one help me?
Thanks in advance.
I think I made some dumb mistake but I can not find it.
|
|
|
|
|
I'm pretty sure you have to Start the timer. If I were you, I would refactor the class so that you had a method like this in it:
Public Sub Start(ByVal IPAddress As String, ByVal IsLogged As Boolean)
IP = IPAddress
Logged = IsLogged
StartSession = DateTime.Now.Ticks
mUTimer.Enabled = True
muTimer.Start
End Sub Then you replace a lot of your code with a simple
CType(CGlobali.Users.Item(i), CWebUser).Start(IP, True)
|
|
|
|
|
Thanks Pete,
but unfortunately my application runs on Windows CE, so it uses the Compact Framework, not the full .NET and in Compact Framework there is not the method Start for the timer.
|
|
|
|
|
Ah. In that case, I would probably look at using System.Threading.Timer instead. Documentation[^]
|
|
|
|
|
Ok, I take a look at this timer.
Thanks
|
|
|
|
|
Sorry but I don't know how to use this kind of timer in the way I need (property of an object).
Any other suggestions about how to make a System.Windows.Forms.Timer work as I need?
Thanks
|
|
|
|
|
Put a breakpoint in your timer tick event and see if it's being hit when you run it in debug. Does it hit the method or not? My suspicion is that it is hitting the method, but there's a bug in the if statement.
|
|
|
|
|
I put a breakpoint on line
If ((DateTime.Now.Ticks - mStartSession) > (CGlobali.WebSessionDuration * 10000000)) Then
but the debug never stop there
|
|
|
|
|
And if you set the breakpoint in SetWUser? Is it actually executing this line?
CType(CGlobali.Users.Item(i), CWebUser).WUTimer.Enabled = True
|
|
|
|
|
yes, the line is executed and the property WUTimer.Enabled is really set to true, to check it I wrote just after that line something like this:
Dim aaa As Boolean
aaa = CType(CGlobali.Users.Item(i), CWebUser).WUTimer.Enabled
and aaa become true.
It seems like the instruction
AddHandler (mWUTimer.Tick), AddressOf WUTimer_Tick
does not link the sub WUTimer_Tick to the event mWUTimer.Tick
|
|
|
|