Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Environment.OSVersion is fine. You just have to figure out what to do with the version numbers it gives you. Do some research.
  2. For a simple request like this you don't have to do any drawing, you can simply assign an Image to the BackgroundImage of the form and it will do the drawing for you. To load a bitmap from disk, you use the constructor for the Bitmap class: Dim b As New Bitmap("c:\mybitmap.bmp") Me.BackgroundImage = b To draw it yourself, you would skip that second like and keep b around in memory. In the Paint event of the form you would use the DrawImage method of the Graphics class passed to the event under e.
  3. You are concatenating a string each time, which means completely recreating it for every byte in your file. To instantly convert a byte array in to a string, look at System.Text.Encoding.ASCII.GetString().
  4. You can get the absolute position of the mouse cursor (which is what the location of your form should be set to) using Cursor.Position.
  5. Not magically no :) I'm assuming when you talk about enumeration stuff you have a vb6 class which serves as a collection of another class (I don't have time to download the project right now). To make collections in vb.net, you inherit from collectionbase.
  6. The .NET-friendly way of doing this (I think) is with text encoding, as follows: Dim c() As Char = System.Text.Encoding.ASCII.GetChars(New Byte() {65}) 'c(0) = "A"
  7. Is there a reason your application has to be designed this way? It sounds almost like you're neglecting the OOP features of C# to do procedural programming.
  8. I should have said this before - although the syntax will mostly be familiar to you, the real work comes with learning the class library. Just like with C, there's learning the language and then there's learning to use it to actually do things. The .NET framework class library is immense, and you will likely spend many years picking it all up.
  9. And yes, you do need to distribute your Interop assembly.
  10. Front Page extensions are extensions to the IIS webserver. If you only have XP Home, you don't have IIS. You'll have to do without ASP.NET I'm afraid. On the other hand, you could try out Web Matrix, Microsoft's free ASP.NET IDE. It comes with its own "lite" web browser that supports ASP.NET.
  11. XP home edition does not have a webserver.
  12. Properties are still there in vb.net, only using slightly different syntax. Also there is just Get and Set, no Let. If you're porting a collection class, you'll probably have to rewrite it inheriting from CollectionBase.
  13. Your question has given me the neat idea of calling all my exceptions "up" just so I can Throw Up in my code :)
  14. a) True OOP, potential portability of code, vastly more API wrapped in the class library than was available in VB6 b) Pretty much, with extra bits to cater for OOP design and casting c) .NET knocks the socks off Java
  15. SystemInformation.FrameBorderSize SystemInformation.FixedFrameBorderSize SystemInformation.CaptionHeight
  16. You're stuck with it. That's what DLLs are for.
  17. URL Encode the string with Server.URLEncode (I think).
  18. For a string containing a full path, you can use System.IO.Path.GetFilename() to extract just that portion of it.
  19. I would guess Response.Write. If this was an ASP.NET question it should have been posted in that forum.
  20. Dim sFile As String For Each sFile In sFiles Debug.WriteLine(sFile) Next
  21. By looping through the array. I'm sure there are examples of this in the help file.
  22. Yes, you do it in chunks at a time instead of byte by byte: FileStream f = new FileStream(@"c:\verdana.ttf", FileMode.Create); Stream s = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("WindowsApplication7.verdana.ttf"); byte[] b = new byte[4096]; int i; while (true) { i = s.Read(b, 0, 4096); if (i == 0) break; f.Write(b, 0, i); } f.Close();
  23. I was able to accomplish this (with verdana.ttf embedded) like this: FileStream f = new FileStream(@"c:\verdana.ttf", FileMode.Create); Stream s = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("WindowsApplication7.verdana.ttf"); byte b; int i; while (true) { i = s.ReadByte(); if (i == -1) break; b = (byte)i; f.WriteByte(b); }
×
×
  • Create New...