User Profile

Collapse

Profile Sidebar

Collapse
bvrwoo
bvrwoo
Last Activity: May 14 '12, 11:30 AM
Joined: Aug 29 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Well, you have to consider that fact that you might be losing focus on the listbox.
    First,
    Code:
    if (listbox.SelectedIndex > -1)
    {
       int index = listbox.SelectedIndex;
       Loan l = (Loan)listBox.Items[index];
       listbox.Items.Remove(listbox.Items[index]);
       list.Remove(l);
    }
    See more | Go to post

    Leave a comment:


  • Also, if you want your Login to change when you are in another form and click for response, you can pass a delegate to the login to pick it up and change automatically. Make use of C# type function pointers (delegates) which I still prefer C/C++ for pointers any day of the week but .NET has a lot to offer to make your programming easier.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to open a streamwriter/reader
    You must keep the file open while writing because when you close all operations are processed and then the file is close and unmanaged resources are destroyed.
    Code:
    using (TextWriter tw = new StreamWriter(file))
    {
        foreach (string s in strings)
            tw.WriteLine(s);//or whatever you are saving as string
    }
    you don't need to call on tw.Close() because it is in a 'using' block which you can use for...
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to Trouble initializing mixed type array
    It is better to write a struct or a class for this because you are encapsulating. When you insert a struct as an object (goes on the heap) is has to be boxed and then unboxed when you cast it back. This is overhead. Make the struct using good programming practices.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to How to handle lstbox values
    If you only want the the 1st showing up then you have to clear the list and set only the item as the source if you are displaying only one, else you will see them all inserted into the list hence the name data source. You have the observablecolle ction right but when you bind data from a list, the whole list is inserted.
    See more | Go to post

    Leave a comment:


  • use a regular expression for URL format on the the line. If the line is a match but it in your string list or array.

    Code:
    List<string> list = new List<string>();
    using(TextReader reader = new StreamReader(/*filename*/)
    {
       while (!reader.EndOfStream)
       {
          string line = reader.ReadLine().Trim();
          if (Regex.IsMatch(line, your url pattern, Regex.IgnoreCase))
             list.Add
    ...
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to UnmanagedType.LPArray in structure
    I am not sure that you can marshal the size of anytype because you can only marshal structures I believe do the CLR reallocating the heap which you cannot control. Thus is the same reason you cannot use the fixed keyword on a class type to point to. In cases like this it is far better to use C++/CLI.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to C# Decryption problem
    Dude, you can only encrypt it so much. When you encrypt something you do it in 16/32/64/128 bit encryption but not encrypt it twice else you can lose the data or be unable to decrypt it of a read failure.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to why error double + double ???
    Read on conversion. No percision is exact with double (and even floats). You have to remember that you are using 8 bytes of memory with 64 bits of 1 and 0's in machine code for your number. It can only get so precise with floating points of exponents (include 32bit (float) exponent of 8).
    See more | Go to post

    Leave a comment:


  • What do you mean by interchanged? Are you looking to copy it or clone the copy? What?
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to counter increment in a program
    You need to read the lines from the file first and then you need to pass in the line(s) you want to append with File.AppendAllT ext with the file name and line which is the context.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to counter increment in a program
    Before you can append a file you must have some content (line(s)) to append.
    First, use StreamWriter/TextWriter to add you the lines and append the ones you want to changed.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to How to write assemblies for given dll file
    You still would need a strong key for GAC assemblies using the command line. A better way is just to write your core in C++ and then use C++/CLI as the wrapper for .NET into a dll linking the your .lib files and .h files to the project.
    See more | Go to post

    Leave a comment:


  • Does your dll have a .def file? Linking the DLL (plus .H and .LIB) in a C++ project does not need .def if using __declspec(dlle xport) before the function, but it does with C#/VB.NET.
    See more | Go to post

    Leave a comment:


  • bvrwoo
    replied to Using Like statement in parameters
    You must cast it to datetime because my default the DBO will save it as a text.
    See more | Go to post

    Leave a comment:


  • You cannot use '\' slash for directory you must either use '\\' or '/'. '\' is reserved or char text command like '\t' (tab),'\0' (no character) etc... Or use can use the verbatim before the "(text)" which will ignore commands, like @"C\Users\Admin istrator...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...