Search:

Type: Posts; User: Magos

Page 1 of 20 1 2 3 4

Search: Search took 0.05 seconds; generated 17 minute(s) ago.

  1. Replies
    6
    Views
    2,968

    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,921

    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
    3,129

    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
    3,699

    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
    14,433

    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
    8,019

    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
    8,019

    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
    8,019

    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,499

    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
    4,556

    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
    4,556

    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
    10,841

    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
    2,339

    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,421

    System.Collections.Generic.HashSet

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

    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
    3,473

    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
    4,028

    Use ">>>&&

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

    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,885

    Check out System.Security.Cryptography and...

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

    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
    3,003

    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 499
Page 1 of 20 1 2 3 4