|
Try changing your class so that it looks like this:
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()
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
Public Sub EnableTimer(Byval IpAddress As String, ByVal Name As String)
IP = IpAddress
UserName = Name
mWUTimer = New System.Windows.Forms.Timer()
mWUTimer.Interval = 10000
AddHandler (mWUTimer.Tick), AddressOf WUTimer_Tick
mWUTimer.Enabled = True
End Sub
End Class Then call EnableTimer from your loop.
|
|
|
|
|
Thanks for your effort.
I did what you suggest but the result is the same: the tick event is not fired.
I fear it can be a problem related to thread.
The web server is a class with a thread that start the listener to receive connections from remote.
In the main thread of the application I instantiate an object WebServer and in this way I start its thread (the thread is created and started in the sub New() of the class).
The list of users (objects of the class CWebUser) is created in the main thread of the application.
The sub SetWUser(...) that enable the WUTimer is part of the class of the web server and is called by the function VerifyLogInData(...) called in the loop of the thread of the web server...
Is it possible that the problem is that I try to use from thread X a method of an object created in thread Y?
|
|
|
|
|
Yes it is...
I have solved the problem enabling the timer from a sub in the main thread and colling this sub with the Invoke function from the web server thread.
Bye!
|
|
|
|
|
steve_9496613 wrote: mWUTimer = New System.Windows.Forms.Timer() According to the documentation[^], that class isn't supported.
The Threading-timer[^] seems to be supported.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Eddy, thanks for the replay.
Your link to the documentation about the System.Windows.Forms.Timer refers to .Net Framework 4.5 but, for this time, I'm luky and in Compact Framework 3.5 (and also .NET Framework 3.5) this timer is supported.
The System.Threading.Timer is supported, as Pete O'Hanlon suggested, but I have some problem to put one of this timer in my class as a property (I mean like I did with the Form.Timer).
|
|
|
|
|
steve_9496613 wrote: Your link to the documentation about the System.Windows.Forms.Timer refers to .Net Framework 4.5 Only for the member-listing; you can select the version with a dropdown at the top. The "version information" and "platform" heading isn't limited to .NET 4.5 - it simply lists where this class is supported.
steve_9496613 wrote: Compact Framework 3.5 (and also .NET Framework 3.5) this timer is supported. Not according to MSDN.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
steve_9496613 wrote: I'm sure you're right but ..but I wasn't
Yes, that happens too.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
am working on a word document Programmatically using C#.net, Interop.Word, I have paragraphs in this document starting and ending with a "#".
Example:
Once upon a time, there was a #little girl who lived in a village near the forest. Whenever she went out, the little girl wore a red riding cloak, so everyone in the village called her Little Red Riding Hood.#
One morning, Little Red Riding Hood #asked her mother if she could go to visit her grandmother as it had been awhile since they'd seen each other.#
"That's a good idea," her mother said. #So they packed a nice basket for Little Red Riding Hood to take to her grandmother.#
Now between all # I need the text be bold
Any HELP!!!
|
|
|
|
|
nagham_4ng wrote: Any HELP!!!
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thx Eddy, I know how to deal with word documents and ranges, my prob here is that I don't know the index of the characters #, plus that each 2 consecutive # make one range
|
|
|
|
|
nagham_4ng wrote: my prob here is that I don't know the index of the characters # You'd need to search for it.
nagham_4ng wrote: plus that each 2 consecutive # make one range When you find one, turn bold on. Find another, turn it off.
How to: Programmatically Search for and Replace Text in Documents[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I am trying to use RichTextBox to display a RTF file created by Microsoft Word.
I am using the
RichTextBox1.LoadFile(@"c:\test.rtf"); to load the data into the box.
Everything is fine except all the embedded graphics show up let justified.
The Word RTF file has them set to be behind the text and absolute positioned so there can be in middle of text field or where ever.
Is there a easy solution for this?
FWIW, it is a view for a help file that I wish to have icons and images included in.
Thanks in advance
Highflier
.net c# winforms
|
|
|
|
|
Word is more advanced than the RTB-component. I'd recommend using HTML.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, I just did not know if I was doing something wrong or what. I mean I am using Microsoft word with Microsoft .Net
I was hopeful that it was just a version issue, But apparently not.
The Web Viewer is doing a good job, I'll stick with that
Highflier
|
|
|
|
|
Member 7748630 wrote: I mean I am using Microsoft word with Microsoft .Net The fact that both contain the word "Microsoft" does not imply that both should show exactly the same. Word isn't included in Windows, the RTF-control is simply a Windows-control - not something .NET specific. It displays RTF relative nicely, but it's not a WYSIWYG-editor. If it was as good as Words' editor-implementation, then it'd be quite easy to write a competitor.
Member 7748630 wrote: The Web Viewer is doing a good job, I'll stick with that Creative! Alternatively, you could automate Word and turn those documents into pictures. Not as good a solution as the web-viewer, since it'd result in small pictures on high-res screens and large pictures in low-res screens.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, My sanity is restored. I was thinking about a custom control that would scroll through a huge JPG file, While it might of allowed for a more stylish look, the thought of updating the image as the app was enhanced just seemed like a real PIA. Not to mention how large the JPG file would be.
Resolved by using HTML solution
Highflier
|
|
|
|
|
hi there,
i'm trying to run this code,
WPF Language Translator[^]
1) when i run the proj. it says "Make sure you are connected to internet" while i'm connected already...
2) help me regarding "appId" where to find it,
either it "Primary Account Key" or "Customer ID" or "Customer App Secret"..
|
|
|
|
|
You need to post your question in the forum at the end of the article so the author sees it.
Veni, vidi, abiit domum
|
|
|
|
|
Kindly don't post the same question in two forums.
|
|
|
|
|
Hi ,
Up to now I have total 2.6 years of experience in asp.net with C#, sql server , wcf ,javascript , and ajaxpro.
I want to do some certification on Microsoft technologies.i.e. MVC4.
Can I appear mvc 4 paper directly. Is there any elgibility to appear this paper.
Pleas help me out with this issue.....I will appreciate you.
|
|
|
|
|
Check out on their website if they have a certification on MVC4.
|
|
|
|
|
In our final project we are going to build a software which will help to employee management system , we want to add a additional feature here which will be finger print scanner . We want to build the main project in c# platform , it will be very helpful if anyone can show us the pathway of how we should advance.
|
|
|
|
|
Given how little information you have put in there, it's almost impossible to say. Do you have any code written? What will the scanner hook into? What platform is the application? Web? Desktop?
|
|
|
|
|
scanner will hook into the finger print of a person , which would be used as a password system. the project is still in the planing phase , so there isn't any code still . and the project would be web based.
|
|
|
|