473,395 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Switching to C#

Short version:

Trying to learn C# - 5 years C++, 2 years Java experience :) Help!

Long version:

I find "Learning C# 2005" by Jesse Liberty to be 'slow', to say the least.
I am skimming through the book, started 2 days ago will probably finish
today.

I've been commissioned to build a C# application by a friend, involving
parsing XML, right click shell integration, uploading to remote servers,
possibly encryption. He has Visual Studio 2003 - so I guess that is what I
am using too :)

In Java it helped to be referenced to documentation on classes I needed to
familiarize myself with.

(Forgive me, I'm not sure the semantics of what I am trying to ask.) What
would be great would be a list of most commonly used .NET components?
(classes/functions?) in descending order - then I could start at the
beginning and just work on familiarizing myself in my own way. (If I don't
see how or why something is used then I can search for an example on
google.)

Any advice? I feel like I could progress quickly if I just had the right
learning tools. If the best tool for me is a book, I am not opposed to
that - but I'm positive it is not the book that I have.

--
LTP

:)
Mar 26 '07 #1
13 1363
On Mar 26, 2:45 pm, "Luc The Perverse"
<sll_noSpamlicious_z_XX...@cc.usu.eduwrote:
Short version:

Trying to learn C# - 5 years C++, 2 years Java experience :) Help!

Long version:

I find "Learning C# 2005" by Jesse Liberty to be 'slow', to say the least.
I am skimming through the book, started 2 days ago will probably finish
today.

I've been commissioned to build a C# application by a friend, involving
parsing XML, right click shell integration, uploading to remote servers,
possibly encryption. He has Visual Studio 2003 - so I guess that is what I
am using too :)

In Java it helped to be referenced to documentation on classes I needed to
familiarize myself with.

(Forgive me, I'm not sure the semantics of what I am trying to ask.) What
would be great would be a list of most commonly used .NET components?
(classes/functions?) in descending order - then I could start at the
beginning and just work on familiarizing myself in my own way. (If I don't
see how or why something is used then I can search for an example on
google.)

Any advice? I feel like I could progress quickly if I just had the right
learning tools. If the best tool for me is a book, I am not opposed to
that - but I'm positive it is not the book that I have.

--
LTP

:)
Being somewhat new to C# I tried the Learning C# book as well. Didn't
grab my attention or pull me into what I needed to learn. That's for
sure. For me I had success using the Sams Teach Yourself Visual C# in
24 Hours book, as well as the Microsoft Visual C# Step by Step book.
These were good introductory texts, and provided enough tangible
details to give me a good foundation for what I needed to know to
start my own projects. Overall I would recommend the Sams book for
most programming languages...

Mar 26 '07 #2
On Mar 26, 2:45 pm, "Luc The Perverse"
<sll_noSpamlicious_z_XX...@cc.usu.eduwrote:
I've been commissioned to build a C# application by a friend, involving
parsing XML, right click shell integration, uploading to remote servers,
possibly encryption. He has Visual Studio 2003 - so I guess that is what I
am using too :)
You'll want to check out System.Xml.XmlDocument and related classes
(the documentation will help you there), System.Web or System.Net.IO
for your uploading (depending on if you're using HTTP to upload or
another protocol) and System.Security.Cryptography namespace.

I'm not sure about where to go for right click shell integration...
but you'll probably do that on installation, and probably via the
registry (Microsoft.Win23.Registry).

Also, be sure to read up on the IDisposable interface; you'll need to
be on the lookout for that, as most classes that implement the
interface use unmanaged resources, which are only freed by calling
Dispose. The using keyword can help make sure you properly dispose of
classes which implement the interface.

Also, C# behaves more like Java than C#, so when you're designing your
program, follow the Java mindset more than the C/C++ one..

HTH
Andy

Mar 26 '07 #3
On Mar 26, 11:45 am, "Luc The Perverse"
<sll_noSpamlicious_z_XX...@cc.usu.eduwrote:
Short version:

Trying to learn C# - 5 years C++, 2 years Java experience :) Help!

Long version:

I find "Learning C# 2005" by Jesse Liberty to be 'slow', to say the least.
I am skimming through the book, started 2 days ago will probably finish
today.

I've been commissioned to build a C# application by a friend, involving
parsing XML, right click shell integration, uploading to remote servers,
possibly encryption. He has Visual Studio 2003 - so I guess that is what I
am using too :)

In Java it helped to be referenced to documentation on classes I needed to
familiarize myself with.

(Forgive me, I'm not sure the semantics of what I am trying to ask.) What
would be great would be a list of most commonly used .NET components?
(classes/functions?) in descending order - then I could start at the
beginning and just work on familiarizing myself in my own way. (If I don't
see how or why something is used then I can search for an example on
google.)

Any advice? I feel like I could progress quickly if I just had the right
learning tools. If the best tool for me is a book, I am not opposed to
that - but I'm positive it is not the book that I have.
I Googled the words "C# for C++ programmers" and found a bunch of
different links and book citations.

Mar 26 '07 #4
Luc The Perverse wrote:
I find "Learning C# 2005" by Jesse Liberty to be 'slow', to say the least.
Professional C# from Wrox.
I've been commissioned to build a C# application by a friend, involving
parsing XML, right click shell integration, uploading to remote servers,
possibly encryption. He has Visual Studio 2003 - so I guess that is what I
am using too :)
And VS 2003 uses .NET 1.1 which is really what you need to know.
In Java it helped to be referenced to documentation on classes I needed to
familiarize myself with.
So do the same for .NET - the SDK comes with complete documentation
of all classes.

You can also read it over the internet if you so prefer.
(Forgive me, I'm not sure the semantics of what I am trying to ask.) What
would be great would be a list of most commonly used .NET components?
java.lang = System
java.io = System.IO
java.util = System.Collections
java.sql = System.Data
(classes/functions?) in descending order - then I could start at the
beginning and just work on familiarizing myself in my own way. (If I don't
see how or why something is used then I can search for an example on
google.)
Start with the docs.

Web version is here:

http://msdn.microsoft.com/library/de...pref_start.asp
Any advice? I feel like I could progress quickly if I just had the right
learning tools. If the best tool for me is a book, I am not opposed to
that - but I'm positive it is not the book that I have.
Specifically about XML look for the XmlDocument class in System.Xml
namespace.

A quick example that illustrates some concepts:

using System;
using System.Xml;

class MainClass
{
public static void Main(string[] args)
{
string[] files = { @"C:\fil1.xml", @"C:\fil2.xml" };
XmlDocument newdoc = new XmlDocument();
XmlElement root = newdoc.CreateElement("root");
newdoc.AppendChild(root);
XmlElement menu = newdoc.CreateElement("menu");
root.AppendChild(menu);
for(int i = 0; i < files.Length; i++)
{
XmlDocument olddoc = new XmlDocument();
olddoc.Load(files[i]);
XmlNodeList elements = olddoc.GetElementsByTagName("menuitem");
foreach(XmlNode element in elements)
{
XmlElement menuitem = newdoc.CreateElement("menuitem");
menuitem.SetAttribute("id",
((XmlElement)element).GetAttribute("id"));
menu.AppendChild(menuitem);
}
}
newdoc.Save(@"C:\allfiles.xml");
}
}

Arne
Mar 27 '07 #5
Luc The Perverse wrote:
I've been commissioned to build a C# application by a friend, involving
parsing XML, right click shell integration, uploading to remote servers,
possibly encryption. He has Visual Studio 2003 - so I guess that is what I
am using too :)
I wouldn't try to do in-process right-click shell integration in .NET if
I were you. Only one version and instance of the .NET runtime can be
loaded into a process, and the shell is a single process. That means
that if your addin (running on 1.1 since it's VS 2003) gets in ahead of
any other addins which happen to be written in .NET, and any of the
other addins are written in 2.0, they'll break.

I'd advise you to write a stub in a native language for the shell
integration, that fires up your application out of process, when needed.

-- Barry

--
http://barrkel.blogspot.com/
Mar 27 '07 #6
Trying to learn C# - 5 years C++, 2 years Java experience :) Help!
>
I find "Learning C# 2005" by Jesse Liberty to be 'slow', to say the least.
I am skimming through the book, started 2 days ago will probably finish
today.
Forgive me but Learning C# was never intended for you; it was intended
for novice programmers. The book that was targeted at you, with your
experience, is Programming C#. You can read about it, and read a
sample chapter (and find supporting documentation and a link to a
private, free support forum) on my web site: www.libertyAssociates.com.
I'm sure there are many other excellent alternative books as well, but
I'm not at all surprised that you find Learning C# "slow," -- given
your experience I would hope that you would. I don't think you'll
find Programming C# slow at all.

By the way, building an application in VS 2003 at this point is a very
questionable decision; it is at least a generation old, and deprives
you of many important features in C# 2. 0 and .NET 2. I'd strongly
advise taking a look at moving to VS 2005; if cost is the issue I'd
far rather see you develop with C# Express (free) than with VS 2003.

Best of luck.

-jesse.

Mar 27 '07 #7
Also, be sure to read up on the IDisposable interface; you'll need to
be on the lookout for that, as most classes that implement the
interface use unmanaged resources, which are only freed by calling
Dispose. The using keyword can help make sure you properly dispose of
classes which implement the interface.
Absolutely complete 100% in the wrong direction. System.Data (AdoNet)
implements AFAIK not one unmanaged resource however all classes implements
IDisposable and therefore everything is finalized by the managed code.

Cor
Mar 27 '07 #8
"Bruce Wood" <br*******@canada.comwrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
>Any advice? I feel like I could progress quickly if I just had the right
learning tools. If the best tool for me is a book, I am not opposed to
that - but I'm positive it is not the book that I have.

I Googled the words "C# for C++ programmers" and found a bunch of
different links and book citations.
A similar search yielded this which I found generally helpful.

http://msdn2.microsoft.com/en-us/vstudio/aa700844.aspx

It is my niave humble opinion that C# truly is based on Java . . with C++
influence. (As opposed to the other way around.) With the semantics of
the language so similar, it would seem that with the exception of a few
minor nuances my goal should be to learn .NET framework - C# will follow :)
So has anything changed? Not really! LOL!!

--
LTP

:)
Mar 27 '07 #9
Cor Ligthert [MVP] wrote:
>Also, be sure to read up on the IDisposable interface; you'll need to
be on the lookout for that, as most classes that implement the
interface use unmanaged resources, which are only freed by calling
Dispose. The using keyword can help make sure you properly dispose of
classes which implement the interface.
Absolutely complete 100% in the wrong direction. System.Data (AdoNet)
implements AFAIK not one unmanaged resource however all classes implements
IDisposable and therefore everything is finalized by the managed code.

Cor
Nonsense. A database connection is definitely an unmanaged resource.

--
Göran Andersson
_____
http://www.guffa.com
Mar 27 '07 #10
<jl******@libertyassociates.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
Forgive me but Learning C# was never intended for you; it was intended
for novice programmers. The book that was targeted at you, with your
experience, is Programming C#. You can read about it, and read a
sample chapter (and find supporting documentation and a link to a
private, free support forum) on my web site: www.libertyAssociates.com.
I'm sure there are many other excellent alternative books as well, but
I'm not at all surprised that you find Learning C# "slow," -- given
your experience I would hope that you would. I don't think you'll
find Programming C# slow at all.
Wow! I did not expect to receive a message from the author of the book I
was commenting on :) BTW - I like your writing style.
By the way, building an application in VS 2003 at this point is a very
questionable decision;
*snip*
I don't doubt that. However, at the current point in time, without too many
details, this contract bid was a bit of a charity project. If he makes a
profit, or even breaks even. (IE if his customers are willing to buy the
application) I will be in a bit more of a position to negotiate.

--
LTP

:)
Mar 27 '07 #11
"Arne Vajhřj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
So do the same for .NET - the SDK comes with complete documentation
of all classes.

You can also read it over the internet if you so prefer.
Aren't there tens of thousands of pages of documentation? It seems a
little overwhelming!
java.lang = System
java.io = System.IO
java.util = System.Collections
java.sql = System.Data
That's easy enough :)
Start with the docs.

Web version is here:

http://msdn.microsoft.com/library/de...pref_start.asp
Book marked thank you
Specifically about XML look for the XmlDocument class in System.Xml
namespace.

A quick example that illustrates some concepts:

using System;
using System.Xml;

class MainClass
{
public static void Main(string[] args)
{
string[] files = { @"C:\fil1.xml", @"C:\fil2.xml" };
XmlDocument newdoc = new XmlDocument();
XmlElement root = newdoc.CreateElement("root");
newdoc.AppendChild(root);
XmlElement menu = newdoc.CreateElement("menu");
root.AppendChild(menu);
for(int i = 0; i < files.Length; i++)
{
XmlDocument olddoc = new XmlDocument();
olddoc.Load(files[i]);
XmlNodeList elements =
olddoc.GetElementsByTagName("menuitem");
foreach(XmlNode element in elements)
{
XmlElement menuitem = newdoc.CreateElement("menuitem");
menuitem.SetAttribute("id",
((XmlElement)element).GetAttribute("id"));
menu.AppendChild(menuitem);
}
}
newdoc.Save(@"C:\allfiles.xml");
}
}

Arne

I see I have a lot of work to do :) Thank you for the example

--
LTP

:)
Mar 27 '07 #12
Luc The Perverse wrote:
"Bruce Wood" <br*******@canada.comwrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
>>Any advice? I feel like I could progress quickly if I just had the right
learning tools. If the best tool for me is a book, I am not opposed to
that - but I'm positive it is not the book that I have.
I Googled the words "C# for C++ programmers" and found a bunch of
different links and book citations.

A similar search yielded this which I found generally helpful.

http://msdn2.microsoft.com/en-us/vstudio/aa700844.aspx

It is my niave humble opinion that C# truly is based on Java . . with C++
influence. (As opposed to the other way around.)
You are of course in title to your opinion. However, it's not really
shared by for example Anders Hejlsberg, chief architect of C#:

"One of the key differences between C# and these other languages,
particularly Java, is that we tried to stay much closer to C++ in our
design."

http://www.windowsdevcenter.com/pub/...berg_0800.html

From a programmers view you might find the similarities with Java more
obvious, unless of course you use things like enums and operator
overloading. Still, it might be valuable to know a bit about the
intentions of the people who created the language.

:)
With the semantics of
the language so similar, it would seem that with the exception of a few
minor nuances my goal should be to learn .NET framework - C# will follow :)
True. There are some things in the language itself that is good to know
about, but most of the learning is getting familiar with the framework.

--
Göran Andersson
_____
http://www.guffa.com
Mar 27 '07 #13
Luc The Perverse wrote:
"Arne Vajhřj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
>So do the same for .NET - the SDK comes with complete documentation
of all classes.

You can also read it over the internet if you so prefer.

Aren't there tens of thousands of pages of documentation? It seems a
little overwhelming!
Yes, but you are not supposed to read it all. The framework is quite
extensive, so you can't learn it all. You can use the documentation to
look up the classes that you currently need to use.

--
Göran Andersson
_____
http://www.guffa.com
Mar 27 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dennis Wheeler | last post by:
I'm trying to find a commandline solution for switching projects. Currently I have to modify the IIS virtual directory path to the source files, and then open the solution file in .Net to be...
3
by: MLH | last post by:
I seem to remember a post in the distant past discussing how to switch to another open application window. IE, if WordPad is running, some API function that'll allow me to switch the focus to that...
2
by: Johann Blake | last post by:
The following is a bug I have discovered using tab pages and threads and I am looking for a workaround. Create a new Windows Forms application and add a tab control with two tab pages. Add a...
6
by: Nicky | last post by:
hi,all We are going to develop a program and when it is running, we need it full screen and also, user can not switch to other place before exit our program. I am thinking, we can make a window...
5
by: JRB | last post by:
Hi, I'm creating a small C#program that communicates through the serial port. I have a separate thread that continuously takes in data from an external device in a while loop. The problem is that...
4
by: sashan | last post by:
Hi Is there a way to enable Emacs/Vim style buffer switching in the VC++ editor? For those that don't know this is where you hit a shortcut key in Emacs/Vim and then type the partial name of the...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
2
by: Frank Swarbrick | last post by:
I had asked a question a few weeks ago about having problems at times accessing DB2 Express-C 9.1, and getting "SQL1032N No start database manager command was issued. SQLSTATE=57019" even when the...
1
by: Dave Rado | last post by:
Hi A while ago I discovered a way of creating css pseudo-frames, that offer users the important benefits of real frames (i.e. the navigation remains visible when you scroll down the page), but...
4
by: adlloyd | last post by:
Hi all, I've got an application that's written in C++ making use of MFC (VS6). Its purpose is to process SMS messages received from a GSM modem connected via a serial port (USB connection). The...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.