Scott Lock

Thoughts on .Net, Caparea.net and Windows Phone


News

My Stats

  • Posts - 77
  • Comments - 127
  • Trackbacks - 21

Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Blogs I Read


Microsoft MVP


User Groups


 

I was looking for something simple to get the file name for the selected file of an OpenFileDialog in C# today.  Of course you can parse the string looking for backslash, etc. It annoyed me that there was no FileText property or something similar which returns this little nugget.

After a short Google search, I found that the System.IO namespace contains Path.GetFileName.  This helpful little static method returns the filename given a path (Path.GetFileName(string path);)   (supported in 1.x, 2.0, 3.0).  If you dig a little deeper, you will see that the Path class has a nice collection of helper methods for getting information about a file, its path, and its directory.  If you reflect on the function, you see that it simply does the parsing for you.

I am sure that every .Net developer already knows this, but its funny how it did not come up very easily when I did my search.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

   Capital Area .Net Users Group Capital Area.Net Users Group
Meeting Announcement - March 27th, 7:00PM


Meeting Announcement - March 27th - 7:00PM - Frank LaVigne - Developing for the Tablet PC

Frank La Vigne

Speaker: Frank La Vigne

Location: AT&T Building, 1900 Gallows Road, Tysons Corner

Learn all about the the basics for building Smart Client applications that leverage the portability and power of the Tablet PC platform. In this session, Frank La Vigne introduces developers to the hardware, software, and development options available to building out Smart Client solutions on the Tablet PC. Adding Ink functionality can dramatically add value to existing applications without adding significant amounts of code and we will see just how easy it can be to take an existing application and add support for Digital Ink, handwriting recognition, and document recognition.

Frank La Vigne is a Microsoft Tablet PC MVP and Lead Architect/Designer for Applied Information Sciences (AIS) in Northern Virginia. Frank started in software development when he was twelve, writing BASIC programs for the Commodore 64. He began his professional career writing Visual Basic 3 applications for Wall Street firms in 1993. He then moved on to be the first webmaster for a major book retailer. Frank then went on to develop a large multinational online banking project in Germany. In 2004, Frank became heavily focused on Tablet PC application development.


Great Food and Prizes!

It's Spring again...Oh my...It's Spring again. And what a way to kick off the new season than with Frank La Vigne and the Tablet PC! Fresh back from the Microsoft MVP Summit in Seattle, Tablet PC MVP Frank La Vigne is chalk full of goodies and nuggets on all that is Ink. There is nothing quite like scribbling all over the front of a perfectly good laptop. If you've tried this at home, you know that you need just the right type of sharpie. Well, if you are utterly confused by all of this then you had better come on out to our March meeting!

I hope to see you there!

Scott Lock
President
Capital Area .Net Users Group


  This Month's Sponsor

Applied Information Sciences


Special Events

3/22/2007 - Microsoft .NET Public Sector Developer Conference

Directions

Forward this to a friend. We would love to see them at the meetings. If they need directions they can visit our web site at http://www.caparea.net/Default.aspx?tabid=59.

spacer image

Caparea.net
Directions



 

 

 

 

 

 

Copyright © CapArea.Net Users Group. All rights reserved.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

My friends at Telligent have a great tool for posting to blogs via email called BlogMailr.  If your blog software supports the Metablog API, you are good to go!  It’s easy to set up and use.  Thanks to my friend Frank La Vigne for turning me on to this tool.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

If you ever wanted to take XML as string in memory, transform it, and out the results as a string:

private bool verifyTransformation(string xml, string xslPath)

{

//create an XPathDocument using the reader containing the XML

MemoryStream m = new MemoryStream(System.Text.Encoding.Default.GetBytes(xml));

XPathDocument xpathDoc = new XPathDocument(new StreamReader(m));

//Create the new transform object

XslCompiledTransform transform = new XslCompiledTransform();

//String to store the resulting transformed XML

StringBuilder resultString = new StringBuilder();

XmlWriter writer = XmlWriter.Create(resultString);

transform.Load(xslPath);

transform.Transform(xpathDoc,writer);

}

Now you can access the results by using the ToString() method of the StringBuilder.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

 

Channel 9  has a video of Scott Guthrie (ASP.Net Team) making an appearance in the popular Halo series, RED vs. Blue.

http://channel9.msdn.com/playground/wpfe/rvbplayer/

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati