Attention: We are retiring the ASP.NET Community Blogs. Learn more >

David Cumps

#region .Net Blog

  • Basic C# Examples

    And because of that, and because I want to raise interest among the people I know, I decided to ask them for questions they had about C#, and try to answer them by example.

    I'm gathering subjects to write on, very basic subjects, appealing to students as well. And I'll try to create an application that answers their question and provides code they could extend.

    Hopefully I can keep this up, because I'm learning a lot from it as well. It helps you to think of subjects you wouldn't have tought of otherwise. And I have to check out docs and examples as well to write an article about it from scratch.

    The first article is about 'How to get on IRC with C#'. I created a basic Console IRC Bot along with some comments. The example uses tcp connections, streams and events. Source code is provided as well.

    I hope other students like the idea... (not only students by the way, everyone can use samples!)

    Let me know if this is a good plan. (Or if you have negative comments, go ahead as well ;))

  • XAML - Irregular Controls

    The Longhorn SDK enables you to create XAML apps from VS.NET, so I did.

    One of the things I'll be looking for is an editor that generates XAML for me. Because, I find XAML "difficult" to write. Yes it's powerfull and "easy" to do, but if you have to do it all by hand, it takes time. So I'm hoping there will be some editor fast :)

    I've seen the demo during the DevDays, where you had a different layout per user. And one of those was the kiddie layout, with the very cool button, which was shaped totally different. So I set out course to create a 'NTFS Permissions For Dummies'.

    Here's what i created in Photoshop as a quick idea of what I wanted:



    Looks kiddie enough, doesn't it?

    Then I started my quest, it seems Longhorn doesn't like it when i want to skew a Listbox with AngleX. When I go over the items it renders strange lines everywhere in my app. Gone was my idea to create these nice shaped controls.

    But the gradient worked! And that's actually very nice.

    Here's what I ended up with:



    It looks kinda nice, the colors still make it look kiddie-like.

    Going to check writing the C# codebehind later on this week if I find some time.

    If anyone feels lucky and has the time, feel free to try to create my attempt in XAML ;) I'd be very gratefull for it, and amazed.

    Update:
    Here's an example of my skew experience: AngleX, AngleY. Notice the blue lines.
    This is the XAML I used. It also happens with other values.

  • Student Evangelist - Longhorn Screenies

    Well, here I am, playing mini-Evangelist in my class, telling about all nice .NET things.

    And now with Longhorn installed, I wanted to show some screenies, and also prove that Pre-Alpha does not mean "If you touch it, it'll destroy your pc" ;)

    I know you can find these anywhere, but these are *my* screenies, my personal sweeties, my preciousssss :)

    First The Desktop.

    Followed by hitting Ctrl-Alt-Del.

    And don't worry, all your great software is still there, like Paint, Calculater and Notepad ;)

    Here you got the proof that the IE team actually does add new things, and that it still exists. One of the features is to Clear Browsing Records. And in the back you see Visual Studio .NET Whidbey, with the nice yellow/green indicators to show which unsaved changes there are and which changes already have been saved.

    And the end of this screenie round is during the Logoff, after which Remote Desktop closed.

    I really like the default look, no kiddie look as in IE. But also not the Win98 look. Very nice black, stylish.

    Regarding layout, Explorer doesn't seem to like me, it doesn't want to set my preferred settings for every map, even if I have told it to do so on every occasion.

  • I'm On Longhorn - Download Manager == Evil!

    I got Longhorn installed!

    I'm guessing the .iso got corrupted during my download.

    It didn't took as long as I expected to install, no 5 hours like some blogs say. But more something like one hour. I didn't use Virtual PC thou, got my laptop running on LH.

    No 4-bit mode on first boot, and after I used my gfx drivers (which installed without any problem) I got it back on 1024x768 on 32-bit.

    First did all the tweaks posted on the net, disable the right dockingbar, disable services, ...

    Everything was running smooth when I rebooted after those changes. Not so terribly slow, althou shutting down takes some time ;)

    It doesn't like Winamp 5, gets closed immediately after it's started. Winamp 2 works great thou. Trillian Pro going fine as well.

    Then I installed VS.NET Whidbey. Which gave me about 3 BSOD. but in the end I managed to install it using the 'Repair' function. Going to look at the dump file later on. Could be that my laptop got to warm and that the hardware went crazy.

    Made my first HelloWorld in Whidbey, I already love the green/yellow status on the side. As well as the great 'Format Document' together with all the new settings about braces and indenting.

    Also did my first XAML file. Then I noticed that I'm missing the Longhorn SDK. Everybody is talking about the PDC DVD. But I only have a CD with Longhorn?

    Anyway, after setting the PATH var to include the 1.2 Framework and setting the LAPI var as well, MSBuild works and everything compiles. Next thing I'm going to look for is how to make XAML files with C# codebehind in VS.NET and compile them there.

    One big annoyance I'm having: the Download Manager is evil!

    I have 2 files in there always saying 'Connecting' and I can't delete or pauze them. If I dare to do that, it doesn't respond anymore, killing explorer doesn't help, logging on again doesn't help either. Only thing I can do is reboot.

    Well, I'm running on LH now. When I have some free time and am somewhat familiar with it, expect some comments on it from me.

    Update: Apparently I can get the SDK anyway, must have looked over it, another 574.1 MB to download.

    Update 2: I can NOT get Longhorn for you, do NOT request it in the comments, I won't give it to you, you have to get it yourself. There's no warez here...

  • Hardware lasts longer under Linux - or how politics don't have a clue.

    As you can read at Jan Tielens' Bloggings, one of our political parties suggest using Linux instead of Microsoft products.

    One of their arguments is that "PC's last longer". Why does hardware last longer depending on the OS that's running on it? Have you ever seen Office destroy your GPU? Maybe when you fool around enough with Linux you can get a driver damage your hardware, but just like with Windows, that's very unlikely unless you're into low level driver development.

    Another great argument of their is they can customize it better. Why do you want to customize PC's in a government building? What would you want to add? It's meant for your end-users, so they'll look at the desktop.

    Regarding the sysadmin side. Guess which one will cost more a Windows sysadmin or a Linux one. No Active Directory for managing your stuff ;)

    They both have decent file permissions and other security settings. Mind you, we are talking about end-user systems here. Not some 24/7 nuclear power plant control server.

    It provide jobs. And installing, configuring and maintaining those Windows PC's doesn't provide jobs? They take care of their own or what? (If that would be the case I should start thinking about switching jobs)

    Then they start talking about Open Standards. There's a difference between Open Source/Software and Open Standards. Microsoft uses open standards as well.

    I'm guessing it's because elections are coming, and we Belgians mostly choose the role of the underdog, Linux in this case. And their party knows how to play the media. With the great 'free' and 'open' words where everyone falls for. (Remember, with open software it's free as in free speech, not free beer)

    They like to point to Munchen in their project. Well one of their arguments that it's cheaper gets destroyed by pointing, because it costs more in Munchen.

    Ah, and price, a Linux version for the desktop (with support, because that's what a company takes), starts at 179$, SUSE is at $598 and Windows XP is at $299. Now tell me, where's the huge difference everyone is talking about?

    We are talking politics here, they interfere in business they totally have no clue of, something they want to do quickly, and now even more then otherwise, because elections are coming, quickly get some arguments and launch them, everyone not into computers will believe us!

    Should I talk about support as well? Who just extended their support for Windows 98? Which is quite old already. Can I get some support on my Linux distro X which seemed to have stopped last year? Can I get some support on package X, developed by a informatics student in his free time who now "doesn't feel like working on it anymore"? That means, if you want to use it, you'll have to get the knowledge to develop it further, and in the long run that is not cheaper.

    And lastly, what about professionalism? They advertise with a movie of the Bill Gates pie-in-the-face happening. And with a page called microsuck.htm ...

    There is one party I'm really not going to vote for. Hopefully they won't ruin it for the rest, because it's we who'll pay for their crazy ideas.

  • Longhorn installation failing - 'An error occurred while copying files'

    I wanted to install Longhorn today. The 'Longhorn Pre-Alpha Client Preview' version.

    So here I go, I format my laptop (which is a test pc) and insert the cd.

    After entering the key, choosing where to install and clicking continue, when the timer jumps to "13 minutes left" I get an error.

    "An error occurred while copying files". That's it, nothing I can do about this.

    I looked on Google for help, but nobody got it, except for one person who fixed it by using another machine.

    Then, I installed Virtual PC 2004 on my main computer and decided to install it there. That must work, after all it's a virtual pc, and everyone else already got it to run on Virtual PC.

    No luck thou, same error message.

    Does anyone have any advice in what I can do? I even don't know where it goes wrong, can I get some debug info here to pass on to the MS team?

    There goes my plan to install Longhorn and Whidbey on my test pc :(

    Love to hear from someone.

    Update: I got some additional info, I mounted the .iso in Virtual PC now, same error. Happens when it has written 424.4MB.

    Update 2: When I install Windows 2000, run the Setup from there it starts saying "18 minutes left", the progress bar goes a bit further, untill the reboot message comes. Then it continues installing with "14 minutes left", and a bit after it goes to 13 it gives the same error again. I'm at a dead end now.