Creating a Service in C# with visual Studio

So you want to create a service in C#? well look no further. This article is amazing and will take you through each step clearly and let you know how to make the service. Highly recommend for creating services in the future.

Share Button

James’ Error codes

The following are Error codes used by James’ programs across platforms:

/// Error Code SE-JEHG-0001 = Programer needs to implement XLVBAInitializer method before running code.
/// Error Code SE-JEHG-0002 = User did not provide a destination for StackEm.
/// Error Code SE-JEHG-0003 = VBA constructed name for destination of stackem is invalid

This list is in progress.

Share Button

Daily Dose of Fiber to Keep your Internet Regular

So you want really fast internet in the calgary area? Well let me do the leg work for you! These websites offer down and up of at least 150mbs and fiber cables.

Share Button

Finally – I found how to get the version number of the dll

It has been a mystery on how to get the version number that is in Visual Studio (eg to show. Now I can use a default method to go and get that or have a “version” method in everything that I build. For now, I have a VBA way of getting it. I would prefer to make a method in the c# class called “version” and put it in all my products – that way if I make .version() exposed to the COM/VBA world, I can still get it from VBA. Here is something I found which will do the trick in c#.

Share Button

Fighting to get a COM visible VSTO Addin so its method can be used by VBA

So I am having some troubles and am learning too much about old technology. In short – my interface is COM visible to my VBA in my Excel code, but not the class. Crap – add the word public in front of class – fixed it. None-the-less here is a blog of what helped me solve my issue. I WANT (insist) early binding (aka intellisense 🙂 ) (Something close to my issue). Want to know even more … look at the links at the bottom of this article.

First – set up things properly.

  • Have a GUID for the interface IMyInterface and on the class MyClassO
  • Have the dual interface turned on on the interface and class

Continue reading

Share Button – it keeps working even if someone breaks it. How to rescue a moved directory seemed like a good alternative for sharing files AND backup AND version control. With any new system, someone tries to breaking (inadvertantly usually) and one needs to recover. Someone moved (copied actually) a sync SHARED folder to the desktop. There also was the same directory stuck in time on the proper spot – so it looked like the sync broke. However, the one on the desktop kept syncing and that was being kept up to date.

There is hiden .syncinfo (not sure exactly what it is called) in each folder being synced. Even if you turn on hidden files – it cannot be seen. Continue reading

Share Button

Locking down RDP for security

Well, it seems after these last ransomware attacks (which I have been a part of the reconstruction crew) I have learnend about other methods of connecting to remote systems. But RDP is a pretty lightweight protocol for remote connection – it works and it works well except for its vulnerability last quarter. So … if we limit HOW we get to the point that RDP is available (VPN w. certs, username, SSL, limiting firewall scope) then we can still use RDP.

But how to we secure RDP down even further? Ideally I would like it where if the certificates match – boom your in only from certain machines. SSH works like this on Unix. Here are some links to peruse that might answer this question. I will augment this article once I have cracked what I wish to accomplish (this sentence will be removed).  Oh – and please do not email certificates or passwords. HUGE pet peave of mine when websites or people do this.

Continue reading

Share Button

Ripping Sharepoint Metadata Apart

I previously blogged about exporting files and metadata from Sharepoint. It worked!!!! Well, now that all the files are extracted – I have ended up with a csv.

  1. seems some double quotes are included – but a proper csv parser (eg. Excel) will turn those into 1 single quote
  2. The Xml column contains an xml node
  3. Add an xml header and a root node
    1. <?xml version=”1.0″ encoding=”UTF-8″ standalone=”no” ?>
    2. <root>
    3. <z:row …..
    4. </root>
  4. Then using Notepad++ with “XML Tools plugin installed” – you can surf the node path with ctrl-alt-shift-P
    1. turns out to be /root/z:row
    2. a c# app – try this article
  5. Also – use the Plugins->xml tools->Pretty Print Attributes
  6. An XPath /root/z:row[@ows_MetaInfo] would get what we require
    1. Parse this crazy thing with CRLF or
    2. The first number 1234;# is the id number – remove it
    3. field:TY|val
      1. field name
      2. TY = type
      3. val = value
    4. Use a regex like this to parse
  7. Now .. undoing the whole thing by hand
    1. undo the HTML Entities – now this will likely be done with the XML API
      1. use the Notpad++ plugin HTML Tag (Plugin->Html Tag->Decode Enitites)
    2. &lt; -> < etc.
    3. unencode entities like #x0020 to a space etc.
  8. To extract thumbnails – they are stored in Base64 – here is a c# app to decode into jpegs


Share Button

How log out as Basic Auth

When you create a website with basic auth there is an unfortunate consequence in that there is no built-in method for logging out the user. Since basic auth username and password are stored on the client side, the server actually has no power to remove what is stored in the user browser’s cache. The solution? Create a log out screen where the user is prompted to put in the wrong password. This is usually counter-intuitive to most log out systems but is unfortunately the only way to get the client’s own browser to replace what is in the basic auth cache. A good example for how to set up the code in order to make this happen can be found at the following website:

Share Button

Setting up WebDAV for IIS 10

In order to set this up for customers to use automatic file transfer via webDAV I found a really good website that seems to provide the perfect method except you skip the last step where you link it to the particular website. Here is the link.  This allows the user to automatically update files on the server.

Then I had to enable some sort of authentication (I used Basic Auth as it was one user). This website filled this in (this guy at Microsoft is stellar – he is a teaching kind of guy) Continue reading

Share Button