CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Jason Isom

Page 1 of 8 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    10
    Views
    1,483

    Re: Constant Members

    Or, if you want to initialize the constants at runtime you can use the readonly attribute and initialize the constants in the constructor.
    ...
  2. Replies
    4
    Views
    949

    Re: Converting bool into numbers

    I believe what you're looking for is, "XOR". I've added the parenthesis for clarity.


    if((example1 > 10) ^ (example2 > 10))
    Console.WriteLine("Yep...");
  3. Replies
    8
    Views
    1,209

    Re: [2005] Auto formatting in the IDE

    Hmm. My installation of Visual C# Express Edition does that change automatically for me, unless I have weird errors before that line of code (ie, leave off a semi-colon, curly-brace, or forget to end...
  4. Re: Help wanted: Database connections and Forms

    Assuming you're using Visual Studio C# 2005, follow these instructions on adding the connection string.

    Then add a reference to the System.Configuration.dll, and anywhere in your code that you...
  5. Re: How-To display Windows installed Security Updates

    If you don't want to reinvent the wheel, you can download the Microsoft Baseline Security Analyzer. The advantage is that the analyzer can determine which updates are needed for that system, which is...
  6. Replies
    2
    Views
    907

    Re: Pausing execution

    Do you want to stop execution of the first form until the second form is opened and closed? Or until the second form is completely opened?

    If it's the former, you could use .ShowDialog() instead...
  7. Replies
    9
    Views
    2,055

    Re: rand.NextDouble() in a loop

    You didn't mention that you had a loop creating the classes, and then for each class instance you had another loop running within a method. :p

    Either way, it sounds like you understand the...
  8. Replies
    3
    Views
    958

    Re: Read and append to a text file

    I haven't tested this, but:

    File.AppendAllText("fileToAppendTo.txt", File.ReadAllText("fileToAppend.txt"));
  9. Replies
    9
    Views
    2,055

    Re: rand.NextDouble() in a loop

    Because you wouldn't be re-seeding your Random object every function call. You'd be re-seeding it every time you created an instance of that class that contains the declaration for your Random...
  10. Replies
    9
    Views
    2,055

    Re: rand.NextDouble() in a loop

    You can make the Random declaration a little more global, perhaps making it a private member of the class that contains the function and initialize it in the constructor for that class.

    You're...
  11. Replies
    9
    Views
    1,312

    Re: Variable declaration error

    If you've set it up exactly like I have it, you can open Microsoft Visual C#, right click the textBox you're trying to apply the event to and select properties. Then in the properties window, there...
  12. Replies
    9
    Views
    1,312

    Re: Variable declaration error

    There is a bunch of different ways you could do this, but an answer closest to the approach you're taking now:


    private bool x_Turn = true;
    private void textBox_Click(object sender, EventArgs e)...
  13. Replies
    9
    Views
    1,431

    Re: ListView Problem

    Can you post a minimal solution that demonstrates the problem from your code? The reason I ask, is that just saying that you have BeginUpdate and EndUpdate isn't enough. If you have BeginUpdate and...
  14. Replies
    9
    Views
    1,431

    Re: ListView Problem

    Try the following:



    ListView.BeginUpdate();
    while(TheReader.Read())
    {
    ListViewItem lv = new ListViewItem();
    MyObj my = new MyObj();
    my.name = TheReader.GetString(0);
  15. Replies
    3
    Views
    936

    Re: Text Box 'ctrl' Shortcuts

    Did you set the ShortcutsEnabled property to false?
  16. Replies
    3
    Views
    745

    Re: object reference exception

    Is there any way that the constructor for MyRequest to return null?
  17. Replies
    4
    Views
    12,966

    Re: get parent path parent directory

    DirectoryInfo di = new DirectoryInfo(@"C:\parent\child");
    Console.WriteLine(di.Parent.FullName);

    and


    DirectoryInfo di = new DirectoryInfo(@"C:\parent\child\");...
  18. Replies
    7
    Views
    1,318

    Re: decimal and Decimal

    This is just a stylistic issue, but you should be consistent with whatever way you choose. I personally use lower case for all types and I use the capitalized version to access the static members of...
  19. Replies
    4
    Views
    2,553

    Re: Visual C# warning

    Just curious, why does ADONetForm1 inherit from class Form, when it doesn't even appear to do anything but call another Form (specifically, Form1). I don't even see a call to...
  20. Replies
    5
    Views
    1,271

    Re: Please help - Convert Image file to bytes

    Is the file on your computer? You could try the following:



    foreach(Byte b in File.ReadAllBytes(@"c:\test\sunset.jpg"))
    Console.Write("{0} ", b.ToString("X2"));
  21. Replies
    7
    Views
    6,061

    Re: C# Initializer List?

    System.Environment.OSVersion

    http://msdn2.microsoft.com/en-US/library/system.environment.osversion.aspx
  22. Replies
    2
    Views
    758

    Re: Find an file on a server

    I wonder if it would be better to ping the machine (via code) and if you get a response, then check if File.Exists(...)

    I ran into a similiar problem checking the status of various Windows...
  23. Replies
    3
    Views
    1,705

    Re: How to invoke a KeyPress??

    Unless I'm misunderstanding you, can use one of the following, depending on whether you want to send the keystroke and wait for the action to take place, or continue without waiting...

    ...
  24. Re: Opening a text file not via dialog

    Without seeing your code, I can only assume you did this:
    System.Diagnostics.Process p = new System.Diagnostics.Process();
    p.Start(pathToFile);Instead of:...
  25. Re: Opening a text file not via dialog

    I'm fairly sure that the operating system would clean up the process after the process ended. The Process class does maintain some information about the process, such as the Process.ExitTime and...
Results 1 to 25 of 197
Page 1 of 8 1 2 3 4





Click Here to Expand Forum to Full Width

Featured