Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

Febret

@Febret
About
Posts
9
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Which function is like "getch()" in Console App?
    F Febret

    I see: if you want to read a single character from the user (any charachter, not an enter key press), and you don't want that character to be shown, the only way to do it on .Net 1.0 /1.1 (the 2.0 Console.ReadKey does the same thing) is to import _getch from msvcrt.dll. You can use this code (by reinux from http://www.codeproject.com/useritems/PressAnyKeyToContinue.asp):

    [DllImport("msvcrt.dll")]
    private static extern int _getch();

    public static int Getch()
    {
    try
    {
    return _getch();
    }
    catch
    {
    return Console.Read();
    }
    }

    Insert this into a class and then you should be able to use Getch() to do what you need. Bye!

    C# csharp question

  • Which function is like "getch()" in Console App?
    F Febret

    Of course not :-D In Framework 1.0 / 1.1 You have to use Console.Read(), as J4amieC suggested. Bye!

    C# csharp question

  • Which function is like "getch()" in Console App?
    F Febret

    Whoops: Console.ReadKey is on Framework 2.0 only, sorry :doh:

    C# csharp question

  • Which function is like "getch()" in Console App?
    F Febret

    Console.ReadKey should do the trick. Bye!

    C# csharp question

  • What to use?
    F Febret

    The best solution would be to use a TCPClient wrapped inside some sort of 'TCPManager' class that implements a timeout service. When you have to send a message the TCPManager class opens the connection and keeps it open for, say, 5 seconds before closind it again if there are no new messages to send.

    C# sysadmin question

  • Process VS Thread
    F Febret

    Basically, there exists a relation one-to-many between processes and threads. That is, a process can host one or more threads but the inverse is not true. All the threads inside a process share the same memory space, while each different process has its own heap. Threads are in general a lighter solution that processes when you need concurrency, but not isolation of the memory space. As for your questions: 1: If one thread throws an unhandled exception your entire application should stop. In the case or processes, in one 'crashes' the others keep running. If you implement a good exception handling mechanism, using threads should not be a problem anyway. 2: Using threads inside an operating system means having all the system memory in common to all the application running inside the system. This means that every piece of code can read and write memory of other applications. In other words, applications would not be isolated, the failure on one program can lead, through memory violations, to the failure of the entire system. Also, there would be no way of preventing malicious code to write on memory areas owned by other threads. Hope this was useful

    C# help visual-studio performance question

  • Class Objects and Equals Operator
    F Febret

    As Marc said, you should implement the ICloneable interface. Notice that if you have to do a simple shallow copy as in the case you exposed, you don't have to write your own copy code, but you can use the Object.MemberwiseClone method instead. (You'll have to implement ICloneable anyway though, because MemberwiseClone is protected) Cheers

    C# question

  • Displaying italicized text on a dialog
    F Febret

    First use the SelectionStart and SelectionLength properties of the control to select the part of the text you want to italicise, the go with this:

    [RichTextBox].SelectionFont =
    new System.Drawing.Font(
    [RichTextBox].SelectionFont,
    FontStyle.Italic);

    Hope it helps.

    C# question

  • Unloading an Assembly loaded via reflection.
    F Febret

    Unloading of single assemblies is not possible. You can unload only at the AppDomain level, so a solution in your case could be loading your assembly in a separate appdomain and then unload it when it is no longer used. For a better explanation on the reasons why you cannot unload single assemblies and alternative ways of doing it i suggest you this Bye!

    C# testing beta-testing help question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups