NiceBytes
          From the world of software development
  Home Projects About Contact  
Login  



Hi and welcome.

I'm a software developer based in Loughborough, Leicestershire in England. I needed a spot to try out new things for websites and host some of my projects, this is it.
Feel free to read my blog.
Archive
January 2014 (1)
September 2013 (3)
August 2013 (2)
July 2013 (1)
 
Detecting a mobile device for your asp.net website10 January 2014
 
If you aren't using a technique to display your site for both mobile and desktop from one page source, this great little bit of VB ASP.NET code will help you redirect to the appropriate version of your site. It is worth noting that I discovered iPads return themselves as a 'mobile device' and there is an override I added specifically for this.

If (Request.Browser("IsMobileDevice") = True) Then
    If (Request.Browser("MobileDeviceModel") <> "IPad") Then
        Response.Redirect("m/default.aspx")
    End If
End If



M. Mee Electrical Web Site Design27 September 2013
 
   Completed my friends website who needed an online presence for his business, comprising of both a desktop/tablet and mobile solution.

Link : M. Mee Electrical



Turn off UAC in Windows 804 September 2013
 
I have discovered in Windows 8 that moving the slider to the bottom does not fully disable UAC anymore. And I still have old programs which need UAC off in order to run correctly.

You need to run secpol.msc -> Security Settings -> Local Policies -> Security Options ->
User Account Control: Run all administrators in Admin Approval Mode -> Disabled.

... in order to turn off UAC completely. Upon doing this it will prompt you to reboot your computer.



256bit AES encryption for sites hosted on Windows Server 200303 September 2013
 
Discovered you can have AES 256 bit encryption on Server 2003. Here's how:

1) Install the fix KB948963 which will install the cipher suites AES 128 and AES 256.

2) The order of the cipher suites on Windows 2003 is hard-coded. AES 128 is the highest priority. AES 256 is the next. You will need to disable AES 128 then AES 256 will have the highest priority.
    a) Open regedit.exe on the IIS 6.0 machine.
    b) Go to HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Control \SecurityProviders \SCHANNEL\ Ciphers. There are a number of subkeys, e.g.  AES 128/128.
    c) In subkey AES 128/128, create a DWORD value “Enabled”. Set it as the value 0. This will disable AES 128.

3) Reboot the IIS 6.0 machine.

Source : AsiaTech



VB.NET Unix time conversion17 August 2013
 
I remembered a post on Stackoverflow.com which I had previously solved which might come in handy.

If you need to convert from unix to .net date or vice verca these small functions take into account daylight saving.

Public Function UnixToTime(ByVal strUnixTime As String) As Date
    UnixToTime = DateAdd(DateInterval.Second, Val(strUnixTime), #1/1/1970#)
    If UnixToTime.IsDaylightSavingTime = True Then
        UnixToTime = DateAdd(DateInterval.Hour, 1, UnixToTime)
    End If
End Function

Public Function TimeToUnix(ByVal dteDate As Date) As String
    If dteDate.IsDaylightSavingTime = True Then
        dteDate = DateAdd(DateInterval.Hour, -1, dteDate)
    End If
    TimeToUnix = DateDiff(DateInterval.Second, #1/1/1970#, dteDate)
End Function



Older Posts >>
ASP.NETCSS3