Ask a FAQ Question

Ask a FAQ Question

Rate This

Do you have a FAQ about:

  • The C# Language or compiler
  • The C# IDE
  • The Visual Studio debugger

Reply to this post, and your question will be added to our list to be answered. Of course, depending on the nature of your comment, and the volume we receive, we may not get to every question.

Note that if your question is not about C# specifically (if it is, for example, a Windows Forms question or a general question about the .NET Framework), it would be better to post that question to a newsgroup or web forum. Visit http://msdn.microsoft.com/vcsharp/community/ for a listing of related resources.

Thanks!

Leave a Comment
  • Please add 7 and 5 and type the answer here:
  • Post
  • How to achieve the following in c#?

    Public Shared Sub foo()
    Static switch As Boolean
    switch = not switch
    End Sub

    public Shared Sub bar()
    Console.WriteLine(foo())
    End Sub
  • In my organization, there's been quite a bit of back and forth regarding what is the "best" way to do string concatenation. Obviously, the "best" case will vary from situation to situation, but it's hard to determine a good guideline for when to switch methods. Can you please discuss the differences between, e.g.:

    string a = "A";
    string b = "B";

    string c = a + b;

    string c = string.concat(a,b);

    StringBuilder sb = new StringBuilder();
    sb.Append(a);
    sb.Append(b);
    string c = sb.ToString();

    ...as well as any additional concatenation methods you'd like to point out? Thanks!
  • i need your help for my project in the college it is about sending multimedia messegethrow mobile device by accessing to the database by dialing a special number.for more describtion send to me your agreement.thanks
  • i need your help for my project in the college it is about sending multimedia messegethrow mobile device by accessing to the database by dialing a special number.for more describtion send to me your agreement.thanks
    my e-mail:tomy331107@yahoo.com
  • It would be nice if "in" keyword in C#, can behave also like TSQL's "in"

    For example:

    int i=1;
    int[] goodValues=this.goodValues; //May be from DB
    int[] badValues=this.badValues;
    if (i in goodValues) && (!i in badValues)
    {
    //i is good, lets do something with it
    }
  • Why C# is consider Faster then any other .Net Language?
  • give the namespaces of programming basics
  • How can i check whether the property has keywords new, abstract, virtual, static, new in its declaration from CodeProperty?

    There's no problem to get access modifiers, but what about the keywords?
  • How do you get text values (from textbox..) into numeric format(int or float) for computations. I have an old prg. (vcpp6) which used the atoi function from C Legacy. What do we use to replace this class of string conversion functions? I have looked into several textbooks and no examples of this were sited.
  • How do you read in a jpeg as a x res * yres matrix of colors values in C# using the compact framework? Im trying to make a web service of something that used to run in matlab.
  • public static void Main()
    {
    int i = 3;
    int j = 3;
    object o = i;
    object o2 = j;

    // Why is the output true? I thought boxing yielded different "boxes"
    // and since System.Object.Equals is identity based the result would be false!
    Console.WriteLine(o.Equals(o2));
    }
  • I would really, really love this feature (and miss it from C++).
  • You have added a Nullable<T> struct to .Net version 2.0, but I would also like to see a Wrapper<T> class, that works just like the Nullabel<T> struct. If it is a class, it would give us the possibility to extend it. We could with a struct win performance because it will not be added to the heap, but is there another reason why you don't have created the Nullable<T> as a class?
  • Structs and boxing make everything more complicated. Structs are objects but in a way they are not. The way Java solves the boxing is less generic but has many advantages. E.g.: you can still add Integer objects.
  • I am tring to generate a lot of random colors so I use the following function:

    public void RandomColor(ref Color c)
    {
    Random R =new Random();
    c=Color.FromArgb(R.Next(256),R.Next(256),R.Next(256));
    return ;
    }

    when i run this from the I get always the same color. But when i use a breakpoint on the code, it works ok.

    Any ideias ?
Page 5 of 14 (196 items) «34567»