顯示包含「.NET Framework」標籤的文章。顯示所有文章
顯示包含「.NET Framework」標籤的文章。顯示所有文章

2013年2月27日星期三

Xamarin (MonoTouch) 免費 Starter Editon

前幾天收到一封Email是Xamarin公司的MVP Offer,可以免費取得價值USD$1,800的Xamarin Business edition,可以用C#語法建立誇平台的iOS和Android程式。

不過有權利就有義務,暫時實在對手機程式的興趣不及其他範疇。
而且沒時間再做更多"義務工作",例如上官方討論區解答問題等等,所以暫時與這東西無緣。

其實我認為Android/iOS開發方面的資料十分充足,如果是C#的開發人員,轉寫Java或理解Android SDK根本沒難度。
是新手的話,為何不學Java,而刻意去學C#使用Mono呢?

所以Xamarin 的前身 MonoTouch推出至今三年有多,其實眼見國外都都反應都有點冷清。
即使官方的討論區也是如此。

如不是MVP的話,新版本2.0有Starter的Free Editon。
之此之前,任何版本都是收費的,推出免費版本加速普及都是必須的。

Xamarin Starter Editon
http://blog.xamarin.com/announcing-xamarin-2.0/

2012年5月8日星期二

為何.NET叫.NET?


若你在Google搜尋的話,便發現很多人都有同一個疑問 - Why was .NET called .NET?

.NET這個名稱,既不Search Engine family,作為Logo/Domain中的一員,又因為那一個Dot - "."太細小或字眼問題,要轉成Dot或放大那一點。
雖然時至今日大家都叫慣叫熟,但我都覺得應該可以有更好的命名。

剛剛又看到一名國外Blogger寫有關的文章 - Why was .NET called .NET?

最多人認同的答案在StackOverFlow - Why was .NET called .NET?
.NET enabled Microsoft's marketing people to emphasise the "Network"-ing aspect of its technologies, and was also a reaction to the marketing blitz by Sun Microsystems in the late 1990s whose theme was "The network is the computer". The term "Dot-Com" was synonymous with the Internet that time, and "Dot-NET" was a play on that term.
或多或少我都同認的,90年代正值Internet發展年代,叫".NET",有點意識流,令人感覺.NET Framework不單是Offline本機的技術,而是關聯到Internet。

2011年6月15日星期三

.NET Framework未日?

大家都睇過Windows 8既Demo,介面跟WP7一樣的Metro UI
我自己就真的不懂欣賞Metro UI。

不過近一星期在外國的.NET Blogger就有很大迴響



因為Windows 8的Native Application不是原先我們認為的WPF或者Silverlight,而是HTML5加Javascript。
所以當有一天Windows 8步入正軌時,一大眾開發Win32軟件的.NET人員怕自己的價值亦同樣地慢慢Fade out。

其實對於一直使用C#/VB寫Windows Form或WPF的開發人員來說,有一天返而要用HTML5+JS寫Windows底下的Native Application是一件很難接受的事。
而就Learning Curve來說,HTML5加各類新型JS Library如Node.js都不會低,重新學習誇平台的Java,或Python,反而可能更快上手,而且更值得投資。

我自己就認為,如果Windows 8一意孤行主力Metro UI,亦不向下兼容的話。
很可能大部份開發者還是專注返Windows 7的Win32平台。
最後演變成Vista時一樣,大部份人都只願意用XP不願升級。

如果想最簡單明白為什麼一眾Blogger都反對激烈的話,可以看這裡:

Why Microsoft has made developers horrified about coding for Windows 8

2010年7月18日星期日

.NET將中文Exception Message轉回英文

假如有人問我軟件上為什麼會優先使用中文版,對我來說其實只是介面上比較親切,中文或英文版使用上都是一樣。
不過如果是開發軟件的IDE,某程度上使用英文版較好,因為輸出的Error Message,放在Google搜尋答案都易一些。

以我自己的平台為例,Windows 7 / .NET Framework / VS2010都是繁中,輸出的Exception Message當然會是繁體中文。
try
{
object obj = "abcd";
double d = Convert.ToDouble(obj); 
}
catch (Exception ex)
{
System.Diagnostics.Debug.Print(ex.Message); //Output : 輸入字串格式不正確。
}

那怎樣轉為英文? 方法如下 :
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
try
{
object obj = "abcd";
double d = Convert.ToDouble(obj); 
}
catch (Exception ex)
{
System.Diagnostics.Debug.Print(ex.Message); //Output : Input string was not in a correct format.
}
但繁中卻不可能轉成簡中,其他語系如日文更不可能,因為英文是.NET Framework的母系語言。

2010年1月6日星期三

2010

遲來了的新年第一Post。
半個幾月冇寫Blog~因為實在忙於打機同清晒電腦中既日劇...
今天公司出了雙糧,十分Happy,因為第一次拎到一張有咁多錢的支票,不過依然動搖不了我5月轉工的決心。
這段時間又要準備OU於2月8日的第三科考試,最後一份功課都未做好,所以依然都是很忙的一月。

上次講左會寫WM手機版的高登,核心部份都完成。不過寫WM軟件就令我覺得WM手機失敗之處和.NET CF有莫大關連。
.NET CF是.NET Framework的Subset,即使相同的Class,但Compact版本的功能都是弱得很。

很多方面都要如VB6般調用API,而且Compact版本上的Control UI樣子是異常地醜陋,所以為什麼大家一般見到的WM軟件都是很Window95 Look的...不是做的人懶,而是先天的問題,各Control可 customize 的 Property 都不多。
不過...當大家睇到微軟的WM開發部門Team人員後,不難理解....
有時我見到個樣咁"山寨"都會冇心機寫下去...

聽聞MS會在Mix10大會公佈.NET CF 4.0支援Xaml的WPF Form,希望是真的,這是唯一的希望,沒有第三方軟件支持的話,即使WM7都沒有用,要嬴iPhone和Android ,這是最後機會,因為如果UI部份還是這樣,我相信沒有太多人願意寫WM軟件。

20100105_gm1-t.png20100105_gm2-t.png20100105_gm3-t.png20100105_gm4-t.png

2009年10月21日星期三

Visual Studio 2010 Beta 2


Visual Studio 2010 Beta 2今日剛剛Release,照以往推出時間來看,應該下年年頭約1,2月就會出正式版。
除了Visual Studio 2010轉了新Logo外,MSDN的Logo都轉了。

而整個MSDN主色都轉為紫色,文章部份再分為Classic / Lightweight / ScriptFree 三個顯示模式,取代之前的 loband (low bandwidth) 模式。

MSDN上已經有大量有關.NET Framework 4.0和Visual Studio 2010的文章可以參考,順道整理一下:
.NET Framework 4.0

Visual Studio 2010

ASP.NET 4

C# 2010

Visual Basic 2010

2009年4月30日星期四

.NET的AndAlso與OrElse

今天看看一個比較Fresh的同事做的VB Project,看到一些(IF中IF),我問他為什麼不用AndAlso,他似乎不知道是什麼,但他寫的C# Code卻有"&&",最後我告訴他,其實"&&"是AndAlso,不是And,他就:( 哦~~~~!!!)
其實除了AndAlso之外,還有OrElse,自.NET第一代已經有。不過的確我看到很多討論區,一些學生問VB功課,他們都是用And/或者Or,可能教他們的老師都是受VB6影響。一些比較老的Code Sample或Soruce Code都比較難見到AndAlso/OrElse的蹤影。而C#上的"&&"和"||",在其他Language中,如PHP,名稱上又的確是"And"和"Or"(PS: PHP也有分"&"/"&&"和"|"/"||",但命名一樣。)
(http://www.w3schools.com/PHP/php_operators.asp),所以.NET新手或者會忽略箇中分別。

AndAlso和OrElse都是一種Conditional Operators,只會在有需要時才運算。

例如以這段Code為例,一定會出現錯誤: FormatException :Input string was not in a correct format.
因為在IF的部份,"a"不可能轉做Integer。
當然你可以分兩段IF...End IF,先TryParse,得到True之後才做Convert.ToInt32。但最好寫法就是把And轉成AndAlso。

轉成AndAlso後,程式會判斷第一部份是否True,然後才決定執行之後部份。
Visual Basic :
Dim s As String() = New String(3) {"1", "2", "3", "a"}
Dim i As Integer
For Each _s As String In s
If Integer.TryParse(_s, i) And Convert.ToInt32(_s) <= 3 Then
System.Diagnostics.Debug.Print(_s)
End If
Next

C# :
string[] s = new string[4] { "1", "2", "3", "a" };
int  i;
foreach (string _s in s)
{
if (int.TryParse(_s, out  i) & Convert.ToInt32(_s) <=3)
{ System.Diagnostics.Debug.Print(_s); }
}

And("&")和AndAlso("&&")的分別 :

And :
Visual Basic :
Dim a As Integer = 1
Dim b As Integer = 1
If a = 2 And b = Convert.ToInt32(Date.Now) Then '產生錯誤 : Invalid cast from 'DateTime' to 'Int32'.
Debug.Print("Hello!")
End If

C# :
int a= 1;
int b= 1;
if (a == 2 & b == Convert.ToInt32(DateTime.Now)) //產生錯誤 : Invalid cast from 'DateTime' to 'Int32'.
{ Console.WriteLine("Hello!");  } 

AndAlso :
Visual Basic :
Dim a As Integer = 1
Dim b As Integer = 1
If a = 2 AndAlso b = Convert.ToInt32(Date.Now) Then 
Debug.Print("Hello!") 'Output "Hello!"
End If

C# :
int a= 1;
int b= 1;
if (a == 2 && b == Convert.ToInt32(DateTime.Now))
{ Console.WriteLine("Hello!");  } //Output "Hello!"

Or("|")和OrElse("||")的分別 :

而OrElse的情況跟AndAlso相似。
AndAlso是只要任何一Part是False的話,都不再執行其餘的expression;
而OrElse則是只要前面的Boolean expression是True的話,後面的就不再運算,直接執行內裡的statement。

Or("|") :
Visual Basic :
Dim a As Integer = 1
Dim b As Integer = 1
If a = 1 Or b = Convert.ToInt32(Date.Now) Then '產生錯誤 : Invalid cast from 'DateTime' to 'Int32'.
Debug.Print("Hello!")
End If

C# :
int a= 1;
int b= 1;
if (a == 1 | b == Convert.ToInt32(DateTime.Now)) //產生錯誤 : Invalid cast from 'DateTime' to 'Int32'.
{ Console.WriteLine("Hello!");  } 


OrElse("||") :
Visual Basic :
Dim a As Integer = 1
Dim b As Integer = 1
If a = 1 OrElse b = Convert.ToInt32(Date.Now) Then 
Debug.Print("Hello!") 'Output "Hello!"
End If

C# :
int a= 1;
int b= 1;
if (a == 1 || b == Convert.ToInt32(DateTime.Now)) 
{ Console.WriteLine("Hello!");  } //Output "Hello!"

2008年11月3日星期一

2008年8月12日星期二

Visual Studio 2008 Service Pack 1 and .NET Framework 3.5 Service Pack 1

等了半年有多的時間了~為什麼我很期待這版Service Pack,因為對我來說重要的更新是
- 修正WebForm Designer的效能
- 增加ADO.NET Entity Designer
- ASP.NET Data Scaffolding Support (ASP.NET Dynamic Data) For GridView, ListView etc..
- ASP.NET AJAX Back/Forward Button History Support
- WPF Performance Improvements

安裝時,要注意,剛從Readme看到:
啟用 Windows Vista 資訊看板時,Visual Studio 2008 SP1 安裝失敗。
若要解決這個問題:
1. 以滑鼠右鍵按一下通知區域中的 [資訊看板] 圖示,位於工作列的最右邊。
2. 按一下 [結束]。

雖然不知錯誤原因,但都是乖乖地先關閉Vista的資訊看板吧。

Introduction
Visual Studio 2008 and the .NET Framework 3.5 enable developers to rapidly create connected applications that deliver high quality and rich user experiences. Visual Studio 2008 enables organizations of every size to rapidly create secure, manageable, and reliable applications that are optimized for Windows Vista™, SQL Server, the Microsoft 2007 Office system and the Web.

Visual Studio 2008 Service Pack 1 (SP1) and .NET Framework 3.5 SP1 continue Microsoft’s investment in market leading development tools and developer platform. SP1 addresses issues that were found through a combination of customer and partner feedback, as well as internal testing. These service packs offer customers improvements in responsiveness, stability and performance.

Overview
http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx
Download Microsoft Visual Studio 2008 Service Pack 1 (EXE Version) (含中文版本)
http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en
Download Microsoft Visual Studio 2008 Service Pack 1 (ISO Version) (含中文版本)
http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&DisplayLang=en
Visual Studio 2008 SP1 readme
Fixes included in this Service Packs (KB945140)
Visual Studio 2008 SP1 Express Editions

2008年3月18日星期二

LINQPad - Free LinQ Query Builder

Well, you don't have to!  LINQPad lets you interactively query databases in a modern query language: LINQ.  Kiss goodbye to SQL Management Studio!

LINQPad supports everything in C# 4.0 and Framework 4.0:

  • LINQ to Objects
  • LINQ to SQL, Entity Framework and DevForce Models
  • LINQ to XML
  • Parallel LINQ

And that's not all - there's also specific support for:

LINQPad is also a great way to learn LINQ: it comes loaded with 500 examples from the book, C# 4.0 in a Nutshell. There's no better way to experience the coolness of LINQ and functional programming.

And LINQPad is more than a LINQ tool: it's an ergonomic C#/VB/F# scratchpad that instantly executes any expression, statement block or program with rich output formatting – the ultimate in dynamic development. Put an end to those hundreds of Visual Studio Console projects cluttering your source folder!

Download LINQPad :
http://www.linqpad.net/

2008年3月14日星期五

LINQ 學習筆記 - LINQ to SQL

記得當時ADO.NET出現其中的一個目的,就是要提供一個Layer可以Offline作業,事實上利用DataSet, DataTable般的In-memory資料集合,的確對Server和程式本身有不少的好處。

LINQ to SQL是LinQ架構下重要的子集,在LINQ Providers中,可以大致分為 :
  1. LINQ to Objects
  2. LINQ to XML
  3. LINQ to SQL
  4. LINQ to DataSets
透過LINQ to SQL,我們可以把整個資料庫轉換成Data Model,當中包含Table的結構,DataType等等。而Data Field本身亦會隨Table成為Member角色,而產生的DataContext亦充當了一個Gateway,例如以往我們使用SQL Command時,發生Command String錯誤,有時會是Remote Side 回存的SQL Exception,但使用LINQ to SQL後,在Design Time時,已經可能知道錯誤,這大大加強資料庫的可程式性。

現在我就示範如何去把Database轉成LINQ 上使用的Data Class。

我使用了SQL 2005的AdventureWorks Sample Database ,在Visual Studio中的Database Explorer加入資料連接 ,Right Click Project => Add New Item ,再選 [ LINQ to SQL Class ] ,之後就會新增一個dbml檔案。

我選用了Contact / Product / Customer / SalesOrderHeader / SalesOrderDetail 五個Table, 在Database Explorer 選取後,把它們Drag & Drop至中間的位置後,Visual Studio 便會自動建立Class至dbml檔案。

greenshot_2008-03-13_16-11-59.pnggreenshot_2008-03-13_16-29-21.png

新增一個Form , 隨意加入一個DataGridView和兩個ComboBox後,建立一個BuildGrid的程序,輸入Code之後,已經可以做到基本的DataBinding了。(如下圖)

greenshot_2008-03-13_16-32-26.png greenshot_2008-03-13_16-35-23.png

嚴格來說,只需要三行的程式碼就可以 :
DataClass.infodata1_DataContext dc = new LINQPlayer.DataClass.infodata1_DataContext();
var select = (from c in dc.Contact where c.ContactID != null select new { c.ContactID , c.NameStyle, Name = (c.Title + ' ' + c.FirstName + ' ' + c.MiddleName + ' ' + c.LastName), c.EmailAddress, c.Phone, c.ModifiedDate }).Take(Convert.ToInt32(cboTake.SelectedItem)).Skip(Convert.ToInt32(cboSkip.SelectedItem));
dgv1.DataSource = select;


不用如ADO.NET般建立SQL Connection ,因為在剛才建立的dbml檔案,內裡已經有Connection String,同時亦免除SQL Command, SQLDataReader 等等,因為當中的var select是Anonymous types , 具有直接存放Data Collection的能力。透過LinQ的Query Syntax,你可以使用屬於extension method,如[skip] , [take] 去做有條件性選擇。

greenshot_2008-03-13_16-49-10.png

作者 : 達Ming
最後更新 : 13-3-2008

原創文章 - 轉貼時請註明出處 : http://tatmingstudio.blogspot.com/2008/03/linq-linq-to-sql.html
(有錯請留言更正,多多指教)

2008年3月13日星期四

LINQ 學習筆記 - Data Class / Data Context

DataClass是可以自行編寫的,但我相信非必要都不會那樣做,因為一個Database動輒有二三十個Table,Column不計其數,要自己編寫的話,真是要花很多時間,而且Visual Studio中又有提供Data Model的Generator。不過學習 LINQ之前,我們都看看DataClass是怎樣做Mapping。

greenshot_2008-03-13_14-07-31.png

我使用了簡單的NorthWind Access DB ,為"Customers"的Table 建立一個Class檔案:
class DCClass
{
// 取得Customers的Table , 進行Table Mapping
[Table(Name = "Customers")]
public class CustomerDC
{
// Column : CustomerID
[Column(IsPrimaryKey = true)]
public string CustomerID { get; set; }
// Column : Name 並轉成 ContactName
[Column(Name = "ContactName")]
public string Name { get; set; }
// Column : City
[Column]
public string City { get; set; }
}
}


在程式中,我就可以使用這個Class了,以Button為例 :
private void button2_Click(object sender, EventArgs e)
{
//建立IDbConnection
IDbConnection MyConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Nwind.mdb;User Id=admin;Password=;");
//建立dc為新的DataContext
DataContext dc = new DataContext(MyConnection);
//建立EntityType的Customers 並取得DCClass中的CustomerDC結構
Table<dcclass.customerdc> Customers = dc.GetTable<dcclass.customerdc>();
//可以直接使用LinQ語法去做Query了
DataGridView1.DataSource = from c in Customers where c.CustomerID.StartsWith("A") select new { MyCustomerID = c.CustomerID, MyCustomerName = c.Name, MyCity = c.City };
}


以上就是基本的DataClass , DataContext , LinQ的示範,但試想下,假如你的Database有廿多個Table,每個Table就有十多個Column的話,可以想像編寫DataClass是十分花時間的。 下一次,我就會示範如何使用LinQ to SQL Designer快速地建立Data Class。

作者 : 達Ming
最後更新 : 13-3-2008

原創文章 - 轉貼時請註明出處 : http://tatmingstudio.blogspot.com/2008/03/linq-data-class-data-context.html
(有錯請留言更正,多多指教)

2008年1月18日星期五

101 LINQ Samples

其實MSDN無論中文版或英文版,Microsoft都是時候整理一下,唔單止MSDN,程式Language本身既專屬網頁都有點凌亂....
很多時候見到的新Topic,可能當時沒有時間看,打算過幾多日才睇,點知過幾日後上去,已經很難找回該網頁...

剛找到參考性極高的LINQ文件,有Visual Basic版和C#版本。

Visual Basic Version : (VB版本似乎內容豐富很多...)
http://msdn2.microsoft.com/en-us/vbasic/bb688088.aspx
C# Version :
http://msdn2.microsoft.com/en-us/vcsharp/aa336746.aspx

2007年11月24日星期六

What are Lambda Expressions?

English:
Lambda expressions, new in Visual Basic 2008, are a handy addition to any programmer's toolbox. They are callable entities that are defined within a function, and they're first-class citizens; you can return a lambda expression from a function and you can pass lambda expressions to other functions. Lambda expressions were added to Visual Basic 2008, formerly code-named "Orcas," in order to support Language Integrated Queries (LINQ), which adds data programmability to Visual Basic (more on that later). As you use lambda expressions, you will begin to see the power and flexibility they promote. I invite you to sample the basic concepts of lambda expressions, explore their benefits, and witness how to use them to write more expressive programs.

http://msdn.microsoft.com/msdnmag/issues/07/09/BasicInstincts/default.aspx?loc=en

繁體中文:
Lambda 運算式是 Visual Basic 2008 的新增功能,也是所有程式設計師的工具箱不可或缺的利器。它們是定義在函式內的可呼叫實體,且是第一等公民;您可以從函式傳回 Lambda 運算式,也可以將 Lambda 運算式傳遞給其他的函式。Lambda 運算式是 Visual Basic 2008 (原來的名稱代碼為 "Orcas") 新增的部分,為的是要支援 Language Integrated Queries (LINQ),這可以提升 Visual Basic 的資料可程式性 (將於稍後詳述)。隨著您使用 Lambda 運算式,您將會了解到它們的威力與彈性。我竭誠邀請您來體驗 Lambda 運算式的基本概念、探索其優勢,以及目睹如何運用它們來撰寫更具表達力的程式。

http://msdn.microsoft.com/msdnmag/issues/07/09/BasicInstincts/default.aspx?loc=zx

What's New in .NET Framework 3.5 - Extension Methods 延伸方法

English:
With traditional object-oriented development, extending classes is typically achieved by deriving from a base class and enhancing the functionality in the derived class. Visual BasicR still supports these object-oriented concepts, but classes are sometimes marked NotInheritable to prevent modification of their behavior through inheritance. As a result, there is no way to customize these classes. An example of this is the System.String class.

A new feature made available in Visual Basic 2008, however, lets you extend any existing type's functionality, even when a type is not inheritable. And these extension methods play a crucial role in the implementation of LINQ.

http://msdn.microsoft.com/msdnmag/issues/07/11/BasicInstincts/default.aspx?loc=en

繁體中文:
在傳統的物件導向開發架構中,類別的延伸通常涉及以基底類別進行衍生,然後在衍生類別中增強功能。Visual Basic 依然支援這些物件導向的概念,但是類別有時候會標示為 NotInheritable,以防止其行為透過繼承而被修改。於是便沒有自訂類別的方法。如此的範例包括 System.String 類別。

但是,在 Visual Basic 2008 中的新功能,可以讓您延伸任何現有型別的功能,即使該型別為不可繼承的型別。而且這些延伸方法在 LINQ 的實作過程中擔任著關鍵的角色。

許多現有的型別都無法在不中斷現有程式碼的情況下輕易更新。如此的範例包括 IEnumerable(Of T) 介面。為了要支援 LINQ,介面中必須加入新的方法,但是加入新的方法對於介面的改變卻會中斷現有消費者的相容性。加入新的介面也是一個可能性,但是建立新的介面來補充現有的 IEnumerable(Of T) 介面,在設計上會變得奇怪。

此情況所需的是延伸現有型別的方法,讓型別可以在不變更現有合約的前提下新增功能。
http://msdn.microsoft.com/msdnmag/issues/07/11/BasicInstincts/default.aspx?loc=zx

Visual Studio 2008 and .NET Framework 3.5 released!!!


就如原定日期,VS2008終於推出~官方網頁亦更新了,Express版官網使用黑色設計,很神秘的感覺^^
同樣有三大版本 : Professional / Standard / Express
最關心的肯定就是免費且可商業用的Express版本,除了基本VisualBasic / C# / C++ / Visual Web Developer 外,VS2008還多了一個叫Popfly的東西.
對我來說,除了WPF,LinQ外,最想試試VWD整合Expression Web後是如何~Microsoft亦很好地整了一個All-in-One DVD ISO,不用分開下載和安裝了~

Visual Studio Home
http://msdn2.microsoft.com/en-us/vstudio/products/default.aspx
Visual Studio 2008 Express Home
http://www.microsoft.com/express/default.aspx
Download the Visual Studio 2008 Express Edition All-in-One DVD
http://www.microsoft.com/express/download/offline.aspx

Resource:
An Overview of Microsoft Visual Studio 2008 White Paper
Visual Studio 2008 and .NET Framework 3.5 Training Kit
Get up to speed on Visual Studio 2008
Visual C# 2008 Keybinding Reference Poster
.NET Framework 3.5 Common Namespaces and Types Poster

2007年11月13日星期二

Visual Studio 2008 11月底推出



上星期Microsoft公告了VS2008會起11月底推出。

換句話說又是各大.NET Programmer既喜又怕的時候,似乎Visual Studio的週期是兩至三年,VS 2003 (.NET 1.1)=>VS 2005 (.NET2.0)=>VS 2008(.NET3.5)相差時間相若,短短幾年時間是否足夠讓程式員去吸引都成問題~

VS 2008包括Visual Basic 9.0,Visual C# 3.0ASP.NET 3.5.而.NET Framework 3.5下包含Windows Presentation Foundation (WPF),Windows Communication Foundation (WCF),Windows Workflow Foundation (WF)等等,另外除了比較出名的LINQ,ADO.NET Entity Framework之外,還有很多新特性,例如Microsoft Popfly Explorer去管理Web Project,亦會整合Expression Web去做Layout Design,至於Silverlight 1.1 Project就不會包括在內。

而免費的Free Version Visual Studio Express版本同樣會有,更詳細可以去MSDN睇睇.


Link:
November Release for Visual Studio 2008 and the .NET Framework 3.5
Learn more about Visual Studio 2008
How to use solutions and projects between Visual Studio 2005 and 2008
Overview of Visual Basic 9.0
Overview of C# 3.0

2007年6月26日星期二

Visual Basic LINQ入門好文章

長久以來,開發人員一直希望能在程式碼中使用資料查詢技術,就像在 SQL 查詢中使用的一樣。現在,透過即將推出的 Microsoft Visual Studio (代號 "Orcas"),終於得以實現這項功能。下一版 Visual Studio 包含一組新的語言功能,統稱為 Language Integrated Query (LINQ),直接將資料查詢功能新增到 Visual Basic 與 Visual C#。
http://msdn.microsoft.com/msdnmag/issues/07/06/VBLINQ/default.aspx?loc=zx

2007年4月26日星期四

Microsoft J#已死

從<DotNet開發聖殿>
看到的消息 , 下一代Visual Studio (CodeName: Orcas) 將不會包含J# ,
J#事實上在全世界已不算熱門流行,IDE只得Visual Studio一個,如果連VS都不再支援,那J#的未來等同死亡。
但J#失寵其實是好多人預計之內的事吧。

J#的對象是Java Developer,但有經驗的Java Programmer根本很多就不會考慮轉向.NET,就算要寫.NET亦會選擇C#而不是J#,這是對象錯誤問題。

我在香港討論區貼出這個消息同時,和人討論了一下C#的將來。
老實說,沒人知道Microsoft如意算盤怎樣打。
但是C#應該不會有什麼問題,.NET語言大體上只得C#和VB,C++開發者又不太在.NET領域。
而且一直以來自.NET 1.0出現,C#都是Microsoft力推語言,而且目前來看是很成功的,至少已搶了自家一班VB.NET開發者.....

無論XNA, WPF, SilverLight, LinQ,全部都有下一代C# 3.0的份。

大體下,C#同VB.NET都是同一個.NET Framework,效能/能力都是一樣,
故所以C#和VB.NET互換性質,始終都有不解之緣,但這亦產生重覆性。

不過我覺得短時間內.NET不會再刪除是但一種.NET語言,因為目前所剩餘的.NET語言,市場佔有率是很高的。

一直都說笑話,BASIC是Bills Gate的親生仔,只要Bills Gate不到死的一天,VB.NET便不會下架,下一代VB 9.0 已經出現,亦有一些Beta Test了。

但不再叫VB.NET,而是打回叫Visual Basic 9.0 (其實我本身都不太喜歡VB.NET叫法,還是叫Visual Basic較親切) ,
C# 3.0當然會同樣收入下一代Visual Studio中。

Visual Basic 9.0 新特性
http://soft.yesky.com/157/2136657.shtml

2006年12月11日星期一

[未來軟件介面3D化] MS Expression Blend + .NET Framework 3.0 WPF 體驗記

很多人都說Windows Vista很正,很好用,介面很靚等等,但近期技術來說,影響最深遠的可能就是.NET Framework 3.0中的WPF (Windows Presentation Foundation)

WPF是軟件上的一個革命,足以改變廿多年來的軟件介面的規範.還是代號Avalon時,我已經被那技術吸引著.幾個月前我在台灣的微軟技術社群討論區詢問過一條問題:( WPF 對ASP.NET 的影響?? )同時.NET 語言底下的要員,但好像卻沒有得益,最後得知原來Microsoft決定開發一個叫WPF Everywhere的項目,目的就是讓Browser運行WPF的程序,或者就可以看待成為了對抗Flash Player,而且還是Cross-Platform的.

之前我有講過XAML語言問題,因為WPF下的介面是XAML而成,但傳統上一直設計介面除了在Design View上做,或者會透過程式碼控制,害怕轉變到XAML後,一時間程式員會很難適應.但幸好是,Microsoft Expression系列中有一個叫Blend的軟件 (前身為Interactive Designer), 這個Blend軟件就是用來視覺地創建XAML.而我亦實質地在Windows XP下實作一個WPF介面的軟件.

PicturePicture

未必的軟件介面可能會是這樣,你有想過嗎?
Blend介面很有型~黑色的介面! 一直都不是Microsoft的風格.Blend支援語言同樣是C#或者VB.NET.
從左手邊的選取Control後,可以任意把Control外觀變型.
PicturePicturePicture
我嘗試放下一個ListBox,想如VS2005般在Porperty加入Item時,出了一個不明的視窗.原來在Blend中,已經不可以好像VS2005般加入Item. 無論是ListItem,Gridview中的Header,Column,Row項目,Blend都把他們分開,需要在Control Box中拉至Design View並放入如Gridview,Listbox的Control中. (見下圖)
PicturePicturePicturePicturePicture

放入過後,可以經由表單的Property,設成Transparent,並測試.
大家看下圖,一個不規則的WPF介面就出現了. 但由於Blend並不可以輸入程式碼,故只可以體驗一下介面而已.
Picture

更多Blend的圖片:
Picture
WPF支援各個Control 重疊和Alpha-Blending.

Picture
這就是Blend創建的XAML碼.

Picture
WPF的3D引擎 ViewPoint3D