Archive

Posts Tagged ‘visual studio’

Convert C# code to Visual Basic,Python and Back.

December 11th, 2009 Jimmy No comments

Some of you .NET programmers may some day find some sample code written in Visual Basic, or C#, but need it in another .NET language. SharpDevelop, a free .NET IDE, has a tool built in that will convert C# into Visual Basic and Python, or Visual Basic into C#, Python and any variation. This video shows you how to do the conversion and it also shows you what it looks like.  When you convert code new source files are created and old source files are retained. This lets you import your newly created source files right into your application.

Will web developers adopt Silverlight without a Linux plug-in?

December 10th, 2009 Jimmy No comments

As many of you may already know Microsoft if trying to edge their way into the embedded Web tools department. With Adobe holding a huge market share on web objects, Microsoft decided to compete with their own product called Silverlight. Unlike Flash, Silverlight delivers a familiar and intuitive development environment similar to Visual Studio and the Windows Presentation Foundation. In fact, you can develop SilverLight applications with Visual Studio if you have all the proper modules and add-ons installed.

Although Microsoft already supports the major browsers on Windows and MAC OSX, they seem to have left the Linux users hanging. Considering that many Netbooks are being sold with Ubuntu Linux, I would think Microsoft would get down and dirty and get those Silverlight plug-ins out, especially if they want to compete with Adobe Flash. From a web developer and designers point of view, they will want to develop websites that are viewable by everyone. Flash is still the web developers and designers choice because no matter what platform the end users is using, their Flash will have a consistent look and feel. SilverLight does the same thing, except Microsoft is lacking in the plug-in department for Linux and some browsers.

Microsoft’s un-official answer is that Novell is working on a Linux version called Moonlight. Moonlight is supposed to be compatible with SilverLight 2.0 and below. Again I have to address another point that web developers won’t want to have to worry if their product will work with third party plug-ins, another downer. Moonlight currently only supports Silverlight 2.0 and below and Moonlight (SilverLight) 3.0 hasn’t even been started based on what I could find on the official Moonlight webpage.

With the exception of tools such as Visual Studio, SilverLight needs to be cross platform supported like Flash or the realy deb developers will never adopt the awesome product. SilverLight is very cool and in my opinion better than Flash as far as what you can do, but we really need that cross browser and cross platform support.

Note: Microsoft’s official FAQ on Silverlight says: “Linux. For the system requirements, please refer to the Mono Project’s Moonlight Web site.” so don’t expect anything from Microsoft directly anytime soon. http://www.microsoft.com/silverlight/resources/faq/default.aspx#sys-req

Implement an RSS reader into your .NET program.

December 6th, 2009 Jimmy No comments

If you’re looking for RSS support in your .NET application head over to RSSdotnet.com and download the latest RSS.NET library. They provide all the source code and API documents you need to add RSS into your program. I haven’t thoroughly reviewed the code but it does work pretty code and seems stable. I’m currently using it in a blog tool I am about to release but more on that later lets see some RSS.NET code!

Below is a very simple implementation on how you can use RSS.NET. Don’t forget to add the project to your solution and add a reference to that project! This should parse out my RSS feed and pause for each item.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rss;
namespace ConsoleRssTest
{
    class Program
    {
        static void Main(string[] args)
        {
            RssFeed feed = RssFeed.Read("http://feeds.feedburner.com/uniprogrammer");
            RssChannel channel = (RssChannel)feed.Channels[0];
            foreach (RssItem Ri in channel.Items)
            {
                Console.WriteLine(Ri.Title);
                Console.WriteLine(Ri.Link.AbsoluteUri);
                Console.WriteLine(Ri.Description);

                //This will let you read each feed as they come in....
                Console.WriteLine("Press any key too continue...");
                Console.ReadLine();

            }

        }
    }
}

Categories: Programming Tags: , , ,

3D Terrain movement with DarkGDK and Visual C++ 2008.

December 5th, 2009 Jimmy No comments

Well I’ve been off and reading all about the DarkGSK development environment for Visual C++ 2008. So far I’ve gone through the first four tutorials which cover the basics of the DarkGDK API. It’s amazing how with just a few lines of code you can have a pretty nifty 3D program up and running. I can already tell that the most time spent in game development is the creation of textures and maps, which I’ll go off and learn how to do eventually. Luckily Microsoft and the DarkGDK developers provide some starter textures, maps and 3D objects to help anyone get going which is great if you just starting off.

Here is a video of end result from the code in the tutorial. I added mouse hooks (two lines of code!) so that I could pan with the mouse as I walk around my terrain map. This was all compiled in Visual Studio C++ 2008 Express which can be downloaded for free from Microsoft.

Continue reading to see the code!

Read more…

Using proxy servers in your C# applications.

December 5th, 2009 Jimmy No comments

This code snippet will show you how to use a proxy server in conjunction with the WebClient class. I’m pretty sure the WebClient class automatically uses your IE configuration (correct me if I’m wrong). This is helpful for those that are developing C# in Linux, but are behind an annoying corporate proxy server.

private string downloadURL( string url )
		{
			WebProxy p = null;
			ICredentials cred;
			cred = new NetworkCredential("myUserName", "myPasword");
			p = new WebProxy("inet1.someproxy.com:80", true, null, cred);
			WebRequest.DefaultWebProxy = p;

			WebClient wc = new WebClient();
			wc.Proxy = p;
			string data = wc.DownloadString(url);

			return data;
		}

Uploading a file with .NET and PHP.

August 25th, 2009 Jimmy No comments

Do you need to upload a file to your php web server from a .Net application? I did, and I found that it was actually pretty easy. Basically the upload.php file works that same way as if you were uploading via a php/html form.
Read more…

Categories: Programming Tags:

How to write a C# TCP/IP client server library.

June 9th, 2009 Jimmy No comments

Below is example code written in C# for a TCP/IP client and server. The TCP server uses what is called a Listener object, which listens for incoming connections. On the client side, the code is written to connect to a specific IP address at which point the server side makes a connection and both client and server can talk to each other. If your working in a DLL project in either Mono, Visual Studio or Sharp Develop, you can compiles this into a client server library (DLL File). Read more…