Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You will need to use the FindControl method of the LoginView control - something like ((TextBox)LoginView1.FindControl("TextBox1")).Text = "Test"; although you need to be aware that if the user is logged in this will return null.
  2. The SelectSingleNode functions returns the selected node - you need to do something like node = node.SelectSingleNode(TheParent)
  3. You will need to configure the DataAdapter with a valid InsertCommand, UpdateCommand and DeleteCommand and then call the .Update(...) method to push the changes back.
  4. Or you could always use XSLT to transform the source into a sorted document.
  5. long l = 4549163506238472; string s = l.ToString("0000-0000-0000-0000"); would be a quicker way.
  6. You might need to loop through the items and manually clear the check status.
  7. Rather than calling the _Click event of the button have you tried using it's .PerformClick() method?
  8. For activities that last minutes or hours then a timer of 20 or 30 seconds would probably be enough, rather than needing to provide accurate figures every second or less the clients could either only update when the event is raised or potentially interpolate figures from averages provided by the server - if the client figures are slightly out then the next real update would correct this. Client side animations would therefore be more of an illustration of server side events rather than an actual, 100% accurate display of them. e.g. using your mining example the figures could be seen walking to and from the mine but the actual timing of when the resources are updated isn't tied into this display.
  9. Not at all, you would only be cynical if you thought they also came from the same ip address...
  10. It might be easiest to create a .Net web service that deals with the .Net 2 Membership / Role providers and then just call this service from your .Net 1.1 application.
  11. It might be worth checking the Images have been correctly installed on the individual PC correctly - or replace them with the correct images again as a precaution. Image.FromFile can throw an OutOfMemoryException when attempting to load a corrupt / invalid file and even when the file is correct but you do not have the correct permissions to read it.
  12. Encoding.Default just uses the ANSI codepage of your PC, this is an almost definate source of problems if you run the application on a PC which uses a different codepage. If uyou know what codepage the characters are from then use the System.Text.Encoding.GetEncoding() method to specify the correct codepage.
  13. Without seeing the actual code itself it is quite difficult to pin down a possible cause for the error... As a starting point check you are disposing of the images etc. when you have finished with them, try running a profiler (http://www.microsoft.com/downloads/details.aspx?familyid=86ce6052-d7f4-4aeb-9b7a-94635beebdda is free) and see what it tells you about memory usage.
  14. for (int x = FileLen; x>=1; x--)
  15. I'll have a look at sorting them - thanks for pointing it out.
  16. Those characters do not have an ASCII value - they are not part of the ASCII character set. http://www.lookuptables.com/ lists the ASCII characters and their values. As stated previously those characters are probably from an ANSI character set, however without knowing the code-page it is a non-trivial (probably impossible) task to convert them to Unicode.
  17. Is your browser configured to use a proxy? If so is it set to bypass local addresses - always a good thing to check. It's also worth checking your hosts / lmhosts files and see if anything in there has been configured for either your ip / localhost.
  18. Will each form log to the same place or to a seperate place? If they are all loging to the same form then as long as the outputform is pointing to the correct form for the logging to be displayed on it shouldn't be a problem.
  19. The Form's .Invoke method has an overloaded version that allows you to pass in an array of Parameters to the function itself. I've just tweaked your code so the check fo InvokeRequired is done inside the Class1.tester method rather than the calling method. The MethodInvoker delegate doesn't allow for parameters / return types so I've also defined a custom delegate for the tester method. Public Class Form1 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click filllist() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim t As Threading.Thread = New Threading.Thread(AddressOf filllist) t.IsBackground = True t.Start() End Sub Private Sub filllist() Dim i As Integer For i = 1 To 5000 Class1.tester(i.ToString()) Next End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Class1.OutputForm = Me End Sub End Class Public Class Class1 Public Delegate Function TesterDelegate(ByVal e As String) As Integer Public Shared OutputForm As Form1 Public Shared Function tester(ByVal e As String) As Integer If OutputForm.InvokeRequired Then Dim o() As Object = {e} Dim mi As New TesterDelegate(AddressOf tester) OutputForm.Invoke(mi, o) Else OutputForm.ListBox1.Items.Add(e) End If tester = 0 End Function End Class I've changed a couple of other things - the filllist method now calls the .tester method rather than the listbox directly and the Class1 now stores a reference to the output form rather than going through the default instance of Form1.
  20. As Cags says if the bytes are above 127 then you haven't got ASCII, it is probably ANSI text. That changes things considerably as ANSI text will also have an associated code-page. Rather than using the ASCII encoder you will need to call the System.Text.Encoding.GetEncoding() method and specify the relevant codepage.
  21. Could you not create a single timer which runs as a 'heart beat' and is the minimum amount of time between 'events', when each heart beat occurs check which events need raising and raise them. Alternatively, depending on the style of game, you might have a very tight game loop anyway - as part of this loop check for events to raise and raise them.
  22. Try displaying the resulting string in a message box rather than to the console - the command prompt doesn't support all character sets.
  23. http://www.xtremedotnettalk.com/showthread.php?t=96716&highlight=services+remote
  24. Everything works fine for me - both buttons populate the listbox correctly, the only problem is the 1st call to the .tester method.
  25. The first call to test.tester isn't being done on the UI Thread, therefore you are encountering the problem the BeginInvoke call is designed to fix. Also you could have done Class1.tester for both calls to the function rather than creating an instance of Class1.
×
×
  • Create New...