Search results for query: *

  1. W

    I'm trying to detect the temporary .tmp file in the FileSystemWatcher Create event

    I'm not sure if it''s going to help you but you can define separate handlers for the different event types // Add event handlers. watcher.Changed += new FileSystemEventHandler(OnChanged); watcher.Created += new FileSystemEventHandler(OnCreated); watcher.Deleted...
  2. W

    [SQLite] File sharing violation

    If your DB is on a network, the below might be the issue. From https://www.sqlite.org/faq.html#q5 So I guess that in that case you're better of writing a small server app that your applications can connect to ;) If your apps are all running on the same machine as the database, there should...
  3. W

    Question Need help by creating an WindowsForm App with ServiceInstaller on button click

    Have you considered to place your parameters in a configuration file. When the service starts, it can read the file and get the 'parameters' that way. No need for passing. If you want to use different parameters, modify the configuration file (I guess that that would be the function of...
  4. W

    Regular Expressions Pattern

    Regular expressions are greedy by default and will try to match as much as possible; it will therefore 'find' up to the last '&' in your input. The first replace in your code will therefore replace the following part of the string start=100&rows=200&fl=doc_ id%2c+doc_cmt_description&wt=csv&...
  5. W

    Question How do I create a random number between two numbers with exceptions?

    I use something like below often; instead of exceptions, I often examine the list to make sure that a random number does not occur twice // list to hold exceptions List<int> exceptions = new List<int>(); // add exceptions exceptions.Add(8)...
  6. W

    get columns totals from listview control

    All summed together in one sum? Or three individual sums (one per column)? For the first one, just repeat your iSum = iSum ... three times for the different columns. For the second one, use three sum variables and in the foreach do the summing like you do now. Not behind a computer to create a...
  7. W

    SystemFileWatcher event not raised after File.WriteAllLines

    You add the changed event handler after you have written to the file. That is too late ;) Move it (up) to where you initialise the filesystemwatcher.
  8. W

    Can someone please explain in detail what the lines in this code does?

    In C# you need to tell the compiler the type of a variable. You (as a person) know that 10.5 is a number and that "hi" is a word. For the available built-in types, see https://msdn.microsoft.com/en-us/library/ya5y69ds.aspx I don't know what custom methods are, so can't say for sure. I might use...
  9. W

    Create repeating elements in xml document from datatable

    Create a list of the objects that you want to serialize, for each datarow add an object to the list and serialize that list.
  10. W

    Processing Large Xml Files

    If all fields are defined, you can consider the use of xml serialisation and deserialisation. You define classes like Dealer, VehicleLocation, EngineDetails etc; for anything that is like an array (e.g. the images) I would use a List<> (List<string> for the images). You combine those into the...
  11. W

    Question Service not sending out messages...

    I know this is a very late reply, but I like to share how I develop services. I basically develop one application that can either be a console application or a service depending on a conditional compilation flag. This makes debugging while developing very simple and there is no need to uninstall...
  12. W

    running from a wired network vs. wireless network

    Size of retrieved records? Magnitude 100 bytes per record or 100,000 bytes per record? If the latter, you might need a redesign (e.g. don't store a picture in the database, but only a 'link' and retrieve it separately (which will still be slow)) or learn to live with it. Another thing to...
  13. W

    Is it possible to call code in application from DLL?

    Thanks. I think you're referring to this type of code. protected virtual void OnStateChanged(EventArgs e) { EventHandler<StateChangedEventArgs> handler = StateChanged; if (handler != null) { handler(this...
  14. W

    running from a wired network vs. wireless network

    Can you explain where the networking comes in? Is the database located on a different computer that you access via a network? If that is the case, how much data do you retrieve at a time? A common mistake is to retrieve all records and filter subsets (e.g. 100 records) for display. It's way...
  15. W

    Is it possible to call code in application from DLL?

    Follow up question I have implemented something and it works. There is however one question that I could not find the answer to. The below code (in the DLL) triggers one of two events and next returns true or false. public bool gotoNext() { currentstate++...
  16. W

    Is it possible to call code in application from DLL?

    Thanks so much. Makes sense. Something to read up on how to do that ;)
  17. W

    Is it possible to call code in application from DLL?

    Morning ( ;)) all, I'm busy with an application and while coding I can see that it can be useful to convert part (one class) of that application at a later stage to a DLL (no experience with creating DLLs, but that is not part of the question). Below code is part of the class that I consider...
  18. W

    Network byte order

    Thanks for the reply and the confirmation that the value that I receive does not represent '2' decimal. Guess I found a bug in the product or product documentation that generates the data :( Notes: 1) I'm aware of the classes and I'm using them. Did not know about 'IsLittleEndian'. 2) This is...
  19. W

    Network byte order

    Not sure where to post this; if in the wrong section, please move. I'm writing a server that receives data from a client. The client spec states that integers are transmitted in "network byte order". The first 4 bytes in my received data represent an (unsigned) 32 bit integer and are show...
  20. W

    Design question

    I'm designing / writing a windows service to check at a certain time of the day if certain files exist in a certain directories. At 10:00 it will e.g. check directory dir001 for the existence of file001 and directory dir002 for the existence of file002, at 16:00 it will check directory003 for...
Back
Top Bottom