User Profile

Collapse

Profile Sidebar

Collapse
GaryTexmo
GaryTexmo
Last Activity: May 27 '14, 09:17 PM
Joined: Jul 16 '09
Location: Calgary, Alberta, Canada
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • GaryTexmo
    replied to Problem with HttpResponse
    Response is something that doesn't exist, you'll probably want to make sure you create an HttpWebRequest. You can then call GetResponse() on that object and that should give you your HttpResponse.

    I only have minor experience with this stuff, but I once got a web page with login working by using an HttpWebRequest to log into the page with my credentials as parameters. I then created a new request for the web page I actually wanted (which...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to DataGridView Multiple columns
    Please don't repost your entire comment just to bump it. It was a holiday weekend in Canada so I wasn't checking the thread.

    For your question, please read and understand what the code does. The variable, dcValue, is just the column I created for the purposes of your example. If your data table has a different column you want to split with, use that instead.

    You don't need to construct dtMain... your adapter.Fill already...
    See more | Go to post

    Leave a comment:


  • I may be wrong about this, but I believe all running applications close when the user logs off. You may want to consider writing your application as a service. I'm not sure how you do it off-hand, but if you start your service as SYSTEM, it should run in the background even when nobody is logged on.

    If the reason you want a console application is so you can log output from your task scheduler, consider logging this to a file instead....
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to DataGridView Multiple columns
    By temporary data, you mean the DataTable I created in the constructor? You should just be able to query your SQLServer and it should return a DataSet for you. I believe there should be a DataAdapter object (probably SQLDataAdapter) that you can set up with a command or connection. Executing it will return a DataSet with the results in it. If you're just doing a simple query, the DataSet will contain a single DataTable (assuming it was successful)...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to DataGridView Multiple columns
    Interesting coincidence... I checked this forum after a long break, roughly 1 hour after you posted that haha.

    I recently changed ISPs so all my links to my old web space are no longer valid. Fortunately I made a backup. Here is an archive with the files you're looking for....
    See more | Go to post

    Leave a comment:


  • You didn't post the code for it but I'm assuming that during the "..." portion of your click you're updating PosX and PosY? If that's the case, you're adding a paint event handler that's going to draw the same rectangle every single time.

    Instead, try creating objects when you click and storing them in a list, then drawing them all. You could easily add a private member to your form that was something like..

    Code:
    private
    ...
    See more | Go to post

    Leave a comment:


  • I don't know how you're reading in your XML but I suggest using an XmlDocument object. This stores a hierarchy of XmlNode objects. These have an Attributes property that provides a list of XmlAttribute objects.

    Whew, lots of linking!

    Anyway, you can use the Name and Value properties of an XmlAttribute object to do what you need. You'll need to follow the hierarchy down until you find the property node, then look for an attribute...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Outlook type Ribbon control
    I've got no experience with this myself, but I did look into it briefly a few years back. You should be able to use the Microsoft one. This should get you started...

    http://tayyab.xenoglaux-solutions.co...-learnt-today/

    You mentioned you did some research so I don't know if you've stumbled across this or not yet.

    If you make any headway on this, it would...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Simple StreamReader issue
    You could try any number of things. A readline would likely work, or a string.Trim. You could also store it in XML.

    Any number of things really :) Just verify the contents of your string using the debugger if your compares aren't working. That's usually a good starting point.
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Simple StreamReader issue
    Oh! Inspect the contents of language directly. Output the length if you have to, or even inspect the ASCII codes. I'd be willing to bet that when you do a ReadToEnd there you're picking up a trailing newline, or perhaps some other end of file type character.

    Take a look :)
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Simple StreamReader issue
    Are you saying none of your cases are hit?

    Can you please post the contents (or at least, the relevant contents) of setup.txt?
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Formatting int as a ASCII char
    Try casting the int to a char and appending to a string.

    Code:
                int aCode = 65;
    
                string resultStr = "" + (char)aCode;
    
                Console.WriteLine(resultStr);
    See more | Go to post

    Leave a comment:


  • Slick thought, Psycho! It still gets Alt-F4 and the icon-click-close in addition to the X, but it doesn't get a call to Form.Close :)
    See more | Go to post

    Leave a comment:


  • The only other thing I might suggest is dig through the WinAPI functions and see if you can figure out where exactly that close button is. Then you can globally check to see if the mouse button is clicked. If so, and if the form is in focus, is the cursor within the bounds of the close button.

    This will likely be tricky. It would be much easier to rely on the form closing event (or what have you), so perhaps you could describe why you...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to How do I serialize the following class.
    I don't know if you can get around it directly... the XmlSerializer uses the public properties to build your objects. You also have to have a parameterless constructor for similar reasons.

    That said, you might be able to implement the IXmlSerializabl e class. This is a less generic approach, giving you control over how things get written/read.

    This might work out for you as is, but if you still have trouble with that internal...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to C# Command Prompt
    See that's extra weird because I was doing mine in a console application and it was still telling me it couldn't find nbtstat. As I mentioned, I tried notepad (which is in the exact same folder) and it worked fine. My code was roughly equivalent to PsychoCoder's.

    Glad it works magically for you though!
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to C# Command Prompt
    Wow, I get the same result. That makes no sense either... I can run notepad.exe just fine and it's in the exact same folder location.

    What are you trying to do? I googled around and it seems like people using nbtstat are usually trying to find a MAC address. If this is the case for you there are apparently other ways to do this that you may want to look into.

    Definitely messed up behaviour though. I couldn't find any explanations...
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Simple (get; set;) question
    Oh yea, look at that, they're also round brackets in your post. See? We all miss stuff! :D

    Glad you got it!
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Simple (get; set;) question
    You don't need the semi-colon after the closing curly brace.
    See more | Go to post

    Leave a comment:


  • GaryTexmo
    replied to Image processing
    I... don't know what you're asking here...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...