User Profile

Collapse

Profile Sidebar

Collapse
Joseph Martell
Joseph Martell
Last Activity: Mar 10 '21, 06:34 AM
Joined: Jan 4 '10
Location: Vacaville, CA, USA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • So you have a couple of options here. It partially depends on the context of what you are doing and where your code lives.

    Without more information, I would probably recommend changing the ReadAccounts method to return the accounts list:

    Code:
    public IEnumerable<AcctRec> ReadAccounts()
    {
         var AcctsList = new List<AcctRec>(); 
         //populate your account list
         return AcctsList;
    ...
    See more | Go to post

    Leave a comment:


  • This took me a while to wrap my head around this and ultimately I just had to write code that utilized both to figure it out.

    An abstract class is an inheritance based concept. It should satisfy the "is a" rule (checkout Liskov Substitution Principle). As an example:
    Code:
        public abstract class Dog
        {
            public abstract void Bark();
        }
    
        public class Bulldog
    ...
    See more | Go to post

    Leave a comment:


  • Can you clarify what you are specifically having a difficult time with? Reading and writing an ini file with the correct format? Dealing with the default XML-based config file format that .net uses?
    See more | Go to post

    Leave a comment:


  • Do the forms have any other relationship to each other besides the order they run in? They aren't MDI forms or anything? Also, do you know how the forms are being run currently? What changes the order they should be opened in?
    See more | Go to post

    Leave a comment:


  • I think you should look to the System.Net.FtpW ebRequest object. MSDN documentation is found here. It includes support for the ftp protocol and should allow you to create directories as well as upload files. The MSDN documentation also includes an example specifically related to uploading a file to an FTP server.
    See more | Go to post

    Leave a comment:


  • That depends: how is the web service formatted? Is it a full SOAP/XML web service with a WSDL? If so you can use Windows Communication Foundation (WCF) to automatically import the types and query methods.

    If the formatting is loose and does not use formal function and data definitions then I believe you are would have to write the code to perform an HTTP request and then parse the response.
    See more | Go to post

    Leave a comment:


  • The type of form factor you are describing is a DIP-7. DIP = Dual In-line Package. 7 is for how many pins are on the package.

    This is going to be pretty difficult since identifying these ICs is mostly done by the markings on the top of the package. Based on your description it sounds like that is not an option.

    Often circuit board manufacturers will have a component designation printed on the actual circuit board. Check...
    See more | Go to post

    Leave a comment:


  • Luuk's answer gets you the location of a point on the screen. If you want the location on your form then you can just use the PictureBox's Location property:
    Code:
            private void pictureBox1_Click(object sender, EventArgs e) {
                Point location = pictureBox1.Location;
            }
    See more | Go to post

    Leave a comment:


  • Joseph Martell
    replied to combobo error in C#
    I think we are going to need more information. I am guessing that LoginPage is a form that you created. The exception is likely being thrown somewhere else and is simply unhandled until this point.

    Can you post the complete stack trace of the exception along with the code for LoginPage?
    See more | Go to post

    Leave a comment:


  • Remember that XML Serialization is meant as a shortcut so you don't have to write as much code by hand to store and retrieve your objects from files. In this case you can actually bypass the data set completely and just put your xml directly into your objects.

    First, you have to fix an issue with your XML Serialization attributes. According to your XML file you are including an array of buildings in each location so Location should...
    See more | Go to post

    Leave a comment:


  • Umarhayat
    It is important to remember that all of the controls and forms that you are using are still classes with properties and methods. The TextBox control is a specific class. A TextBox has a lot of associated properties and methods. One of those properties is Text. I think the following code will work:

    Code:
    std.a = txtpwd.Text
    If further help is needed please post a larger example of your code and please use...
    See more | Go to post

    Leave a comment:


  • Joseph Martell
    replied to Changing IP Address
    Mudassir,

    I have been working on a similar program for quite a while now. I went down the Management Object route at first, but ran into the exact problem you stated above.

    I did not want to use shell commands for various reasons. The next most common answer I saw online was to modify the IP address directly the registry. This has another set of problems, the biggest being that the IP address will not update until...
    See more | Go to post

    Leave a comment:


  • Joseph Martell
    replied to FizzBuzz Question
    There seem to be a lot of errors that I can see in the code. In fact, your code does not compile in my VS 2008 environment.

    If you have posted a code fragment then I would suggest you post in separate code tags so that we can look at individual questions, one at a time.

    If this is your complete code, then there are a lot of things to take care of before it will compile. I would suggest starting with this code as a...
    See more | Go to post

    Leave a comment:


  • Muftah, thanks for the question, but I think you should review this: http://bytes.com/faq.php?faq=posting...ask_a_question

    If you post your attempt at answering this question or specific questions about implementation details, we would be happy to help. Unfortunately, doing assignments outright isn't really what we are trying to promote here.

    Thanks!
    See more | Go to post

    Leave a comment:


  • Joseph Martell
    replied to Why is Trim() Method not trimming?
    An interesting tip from the MSDN page on the Trim() method:...
    See more | Go to post

    Leave a comment:


  • You are correct, but the reason it executes on the UI thread is specifically because of line 5 in my example code:
    Code:
    _updater.SynchronizingObject = this;
    Using a synchronizing object like the windows form ('this' points to the containing form) causes the Elapsed event handler to be executed on the same thread as the UI. Leaving the Synchronizing Object set to null means that the event handler will execute on a separate thread. That...
    See more | Go to post

    Leave a comment:


  • Joseph Martell
    replied to Create A XML doc
    Those extra pieces of information found in the opening tags of XML are called attributes. You need to look into the WriteAttributeS tring method of XmlWriter.

    After your line 10 you would need an extra line of code like this:

    Code:
    writer.WriteStartElement( "book" );
    writer.WriteAttributeString("Key", "A");
    Check out the documentation here (MSDN documentation...
    See more | Go to post

    Leave a comment:


  • You have several options, but which one is best is really going to depend on exactly what you are trying to accomplish, how precise your timing needs to be, and what version of .Net you are using. New parallel processing classes were introduced with 4.0, I believe.

    I would probably use System.Timers.T imer for this task (this is NOT System.Windows. Forms.Timer). It has several advantages. The timing is very accurate, so you shouldn't...
    See more | Go to post

    Leave a comment:


  • Instead of using the automatically generated property syntax, try creating a property in your ConfigBase class that refers to a private static member. There is no rule that says you have to refer to an instance member when using an instance property.

    Something along the lines of this:

    Code:
        public abstract class TestBase
        {
            private static string _path;
    
            public string
    ...
    See more | Go to post

    Leave a comment:


  • Joseph Martell
    replied to How to run software over the LAN
    We had a similar problem at a company that I used to work for. We wound up making a small boot-strap program that would check the user's local copy of the program against a network repository. If a newer version was found it would delete the local copy, recopy from the server and launch the new version. If the versions were the same then it would just launch the local copy.

    Probably not the most "correct" solution, but it...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...