Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You would also need to cast the variable m to the correct type e.g. foreach (RentalItem m in rentalList) { Movie mov = m as Movie; if(mov != null){ if (mov.Director == director) 'etc
  2. It looks as though you are passing the parameter as part of the query string, yet in the markup you are using a SessionParameter, are you copying the query string value into the session first? If not you could just use a
  3. It might be worth trying to log the actual path that raises the error and see what they are doing, there is a good chance they are selecting non-folder things (shell extensions for cameras and similar).
  4. http://blogs.msdn.com/usisvde/archive/2010/03/18/windows-7-taskbar-features-in-net-4.aspx is worth a look.
  5. To get the bomb count you would just need to check the 8 positions around the current location. e.g. if you needed the count for location (3, 4) you would need to check the surrounding eight (2,3) (2,4) (2,5) (3,3) (3,4) (3,5) (4,3) (4,4) (4,5)
  6. How big is the file? Shouldn't take too long at all to attach a file. Does the C# version of the file work fine then and it is the VB conversion that fails? Is it failing on the C# version of the line above? If it is have you tried checking in the debugger which of the variables in the line are null?
  7. If it is possible to remove any binaries from the project then feel free to attach it here. In fact if there is no way to remove the binaries then post it here anyway and I will be able to grab a copy and will then delete to attachment if that is ok.
  8. In the C# code it looks like you have a variable called className which has an event called OnProcessUpdates. The code is then creating an instance of a delegate called ProcessUpdatesDelegate and pointing it to a method in the current class called DoSomething and adding this as the event handler for the event. The VB.Net code suggested by the converter does look correct however, when you say it is completely wrong does it fail in some way or give a compiler error?
  9. The Environment class will tell you this Environment.Is64BitProcess Environment.Is64BitOperatingSystem
  10. Have you tried sending a WM_QUIT to firefox?
  11. Is the hotfix included in SP1 or do you need to install it seperately?
  12. I answered this over at http://www.xtremevbtalk.com/showthread.php?t=315396, hope it helps.
  13. Is this for a windows or a web application?
  14. Any chance you can just post a simplified version of the problem you are having here?
  15. In pseudo code you would want to do something like... Sub SetSelectedItem(subItem as Item) If subItem has children then For Each Child call SetSelectedItem(child node) End If Set subItem as selected End Sub As long as you never have circular references you should be fine, if there are circular references you would need a way to track which nodes have already been visited.
  16. A recursive function is one that will call itself and it can be very useful in solving certain kinds of problems. In your case will you be wanting to return all sub items of all sub items or will there be a way of identifying the one you are after?
  17. I did, think I would be used to counting from 0 by now...
  18. Oops - my bad, caught out by an "off by one error" again. Try byte[] randomData = new byte[deck.Length]; for the array declaration and it should work properly this time. Sorry ;)
  19. One thing I would do is move the line Random random = new Random(); out of the RandomNumber method as creating a new instance of the random number generator for each number is overkill. In fact given how the function is nothing more than a call to Random.Next() anyway I would probably remove the method entirely. In fact personally I would probably simplify the routine and use the built in Array.Sort and the random number generator combined to do all the heavy lifting here. Try the following and see if it does the job... public int[] GenerateDeck() { Random random = new Random(); int[] deck = new int[52]; for (int i = 0; i <= deck.Length-1; i++) deck[i] = i; byte[] randomData = new byte[deck.Length-1]; random.NextBytes(randomData); Array.Sort(randomData, deck); return deck; }
  20. The code you posted should work just fine if you remove the ";" from the end of each line.
  21. Could you not just set the web_request.Proxy property to an instance of the WebProxy class e.g. web.proxy = New WebProxy("< proxy address", )
  22. easiest way is to add a handler to the Microsoft.Win32.SystemEvents.DisplaySettingsChanged event when either the application is run or when th e form is displayed.
  23. Expense - definitely, hassle however should be very little. VS 2010 will let you target .Net 2, 3, 3.5 or 4 and will even allow a .Net 4 application to load assemblies from other versions of the framework at the same time.
  24. This is possible in 2010 however, the View Call Heirachy will show overrides as well as the actual method calls.
  25. As far as I am aware VS doesn't provide this functionality, I do know that the ReSharper plugin for VS does however.
×
×
  • Create New...