Microsoft Visual Studio 2017 for Mac Preview download + installation + case Demo, 2017 preview
Directory:
0. Preface
1. Online Installer
2. Install
3. HelloWorld
4. ASP. NET MVC
5. Software Download
6. End
0. Preface:
For work reasons, I went to work and carried my Raytheon. I lost 10 catties a month and put my Mac in my company.
Before Mac, we bought a PD Virtual Machine to run...
Now, I finally got chicken soup-with the release of Visual Studio 2017, the for Mac version was also born,
You can download it on the Visual Studio official website, but it may be a little slow. I uploaded Baidu cloud. Download the article at the end.
Mac installation is always very simple. You can load images and drag them to the App. Here we will take care of new users and briefly describe the process:
[PS: That's enough. I wrote this article and the browser crashed N times. The number of times it was rewritten. ===]
1. Online Installer
The downloaded VisualStudioforMacPreviewInstaller. dmg has a size of 23.9 MB. This is the installation program. In other words, it is installed online.
(Download at the end of the article)
Double-click image loading:
1 using System; 2 using System. configuration; 3 using System. data. sqlClient; 4 5 namespace HelloWorld 6 {7 class MainClass 8 {9 public static void Main (string [] args) 10 {11 string connStr = ConfigurationManager. connectionStrings ["ConnStr"]. connectionString; 12 13 string SQL = "select name from sysobjects"; 14 15 SqlConnection conn = null; 16 SqlDataReader reader = null; 17 18 try19 {20 conn = new SQL Connection (connStr); 21 conn. open (); 22 SqlCommand comm = new SqlCommand (SQL, conn); 23 reader = comm. executeReader (System. data. commandBehavior. closeConnection); 24 while (reader. read () 25 {26 Console. writeLine (reader ["name"]); 27} 28} 29 catch (Exception ex) 30 {31 Console. writeLine (ex. message); 32} 33 finally34 {35 if (reader! = Null) 36 reader. Close (); 37 if (conn! = Null) 38 conn. Close (); 39} 40} 41} 42}ADO. NET test code
1 using System; 2 namespace HelloWorldMVC 3 {4 public class User 5 {6 public int Id {get; set;} 7 public string Name {get; set ;} 8 public string Email {get; set;} 9} 10}
Modify the Controllers/HomeController. cs controller code, create a User array, and store it in ViewBag:
1 using System; 2 using System. collections. generic; 3 using System. linq; 4 using System. web; 5 using System. web. mvc; 6 using System. web. mvc. ajax; 7 8 namespace HelloWorldMVC. controllers 9 {10 public class HomeController: Controller11 {12 public ActionResult Index () 13 {14 var users = new [] 15 {16 new User () {Id = 1001, name = "Zhang Dong", Email = "778078163@qq.com"}, 17 new User () {Id = 1002, Name = "Catalina", Email = "katelinna@qq.com "}, 18 new User () {Id = 1003, Name = "blind monk", Email = "mangseng@qq.com"}, 19 new User () {Id = 1004, name = "mongana", Email = "moganna@qq.com"}, 20 new User () {Id = 1005, Name = "Bounty", Email = "shangjin@qq.com"} 21 }; 22 23 ViewBag. users = users; 24 25 return View (); 26} 27} 28}
Modify the Views/Home/Index. cshtml code to display the information of the saved array:
1 @ if (ViewBag. Users = null) 2 {3 <p> no data. </P> 4} 5 else 6 {7 <table> 8 <thead> 9 <tr> 10 <th> Number </th> 11 <th> name </th> 12 <th> email </th> 13 </tr> 14 </thead> 15 <tbody> 16 @ foreach (var item in ViewBag. users) 17 {18 <tr> 19 <td> @ item. id </td> 20 <td> @ item. name </td> 21 <td> @ item. email </td> 22 </tr> 23} 24 </tbody> 25 </table> 26}
Click Run:
1 <! DOCTYPE html> 2
Run again:
OK. You're done ~
5. Software Download
Online installation + VS installation package and download
6. End
Haha, at this point, all the tests have been completed, and it feels good.
It seems that there is no form application...
Okay, you can play it on your own. If you have any questions, let's leave a message to share your feelings. Haha.