Search:

Type: Posts; User: Magos

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    6
    Views
    2,394

    Check out Open XML SDK: Download Open XML SDK...

    Check out Open XML SDK:
    Download Open XML SDK 2.0 for Microsoft Office from Official Microsoft Download Center

    Another way is to use Excel interop, but that will require Office/Excel to be...
  2. Thread: C# GUI form

    by Magos
    Replies
    3
    Views
    1,610

    In the "Dock"-property, select "Fill" to...

    In the "Dock"-property, select "Fill" to autoplace it over the whole parent area.
  3. Replies
    1
    Views
    1,946

    First I'd suggets using jQuery.ajax() – jQuery...

    First I'd suggets using jQuery.ajax() – jQuery API for ajax rather than your own methods.

    To return data from an asp.net page simply use Response.Write ( HttpResponse.Write Method (String)...
  4. Replies
    7
    Views
    2,919

    Reading one byte at a time is a pretty...

    Reading one byte at a time is a pretty inefficient method.
    Use this method instead: Stream.Read Method (System.IO)
    (create a 512-byte buffer that you pass to it)
  5. Replies
    3
    Views
    10,611

    Look up the implicit operator: implicit...

    Look up the implicit operator: implicit
  6. System.Runtime.InteropServices.Marshal.SizeOf

    System.Runtime.InteropServices.Marshal.SizeOf
  7. Dictionary should be indexed with...

    Dictionary<string, int> should be indexed with one string, you're trying to index it with two integers.
  8. System.Array isn't generic so it can't implement...

    System.Array isn't generic so it can't implement those generic interfaces.
    As for why it isn't generic is probably a relic due to backwards compatibility.
  9. Replies
    13
    Views
    6,442

    Or, if you hate nesting too much: :P public...

    Or, if you hate nesting too much: :P


    public void AppendFile(String file_to_read, String file_to_append)
    {
    using(var fs1 = new FileStream(file_to_read, FileMode.Open, FileAccess.Read))
    ...
  10. Replies
    13
    Views
    6,442

    Reading your post in more detail I see the actual...

    Reading your post in more detail I see the actual question was appending.
    The simplest way of this, assuming it's a textfile (most common when appening I guess), is this:

    ...
  11. Replies
    13
    Views
    6,442

    If you're always reading from a file the simplest...

    If you're always reading from a file the simplest way would be to use:


    System.IO.File.ReadAllBytes("File.ext");

    If not I'd rather use the following than implementing my own low-level reader:...
  12. Replies
    7
    Views
    1,137

    string is a reference type and can already be...

    string is a reference type and can already be assigned null (no need for ?). ? is only used on value types.
    ? is syntactic sugar around System.Nullable<T> boxing.
  13. Thread: swich case

    by Magos
    Replies
    10
    Views
    3,894

    The following code works perfectly fine for me,...

    The following code works perfectly fine for me, no errors, no warnings (warning level 4, highest), tested in framework 2.0, 3.5 and 4.0:


    switch(someNumber)
    {
    case 1:
    case 2:...
  14. Thread: swich case

    by Magos
    Replies
    10
    Views
    3,894

    Use "Direction.South" inistead of just "South"....

    Use "Direction.South" inistead of just "South".
    Yes there is fall-through, if by that you mean:


    case 1:
    case 2:
    case 3:
    break;

    default:
  15. Replies
    7
    Views
    9,992

    ctl.SelectNextControl(ActiveControl, true, true,...

    ctl.SelectNextControl(ActiveControl, true, true, true, true);

    Remove the "ctl.", you should call it on the form, not the control.
  16. Add the Browsable-attribute to the event...

    Add the Browsable-attribute to the event
    BrowsableAttribute Class (System.ComponentModel)
  17. Thread: if (Obj) do

    by Magos
    Replies
    6
    Views
    1,974

    You could do like this: public class Test {...

    You could do like this:


    public class Test
    {
    public Test()
    {
    }

    public static implicit operator bool(Test t)
  18. Replies
    3
    Views
    2,122

    System.Collections.Generic.HashSet

    System.Collections.Generic.HashSet
  19. Replies
    8
    Views
    3,248

    You can make immutable objects (objects you...

    You can make immutable objects (objects you cannot modify once created):


    public class Location
    {
    public Location(int X, int Y)
    {
    this.X = X;
    this.Y = Y;
    }
  20. Thread: c# timer from

    by Magos
    Replies
    5
    Views
    2,139

    Read about System.Diagnostics.Process.Start, and...

    Read about System.Diagnostics.Process.Start, and don't create a window and you won't see the application (if you do a console app you will always get the black window, so do a windows app).
  21. Replies
    18
    Views
    3,475

    Use ">>>&&

    Use ">>>&&<<<"
    (double &)
  22. Replies
    5
    Views
    4,734

    By "instance" you mean the reference (like...

    By "instance" you mean the reference (like pointer)?
    If so then I suppose your question is to check if that control exists in a window (if you want the control, you already have it :) )
    Try:

    ...
  23. Replies
    6
    Views
    2,368

    Check out System.Security.Cryptography and...

    Check out System.Security.Cryptography and System.Convert.ToBase64String.
  24. Replies
    1
    Views
    1,259

    The Click event passes the sender (button): ...

    The Click event passes the sender (button):


    void Button1_Click(object Sender, System.EventArgs EventArgument)
    {
    var Button = Sender as System.Windows.Forms.Button;
    //Store extra data in...
  25. Replies
    4
    Views
    2,417

    And as a sidenote, if you want to use this like a...

    And as a sidenote, if you want to use this like a normal method:


    public static class StringHelper
    {
    public static string GetFirstNumber(this string String)
    {
    var Parts =...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4