To PHP Programmers: Fast execution of C # code Snippets fast running C # code debugging C # C # write people file operations

Source: Internet
Author: User

As a PHP veteran, temporarily received a fire task, help debug a bunch of C # code, I Win8.1 32 bit, install Microsoft Visio 2013 is not installed, install win8.1 comes with IIS6.0,

Installation is successful, dead or alive unable to start the ASP. NET Web site, depending on the prompt service dependent on startup, still cannot start IIS ...

Collapsed. Also put my local mongodb, Apache, MySQL caused the normal start ...


What to do? Can't you debug C # code snippets without Microsoft Visio and IIS?

Not too!

1. First make sure you have installed. NET Framework and then put the. NET directory to the system environment variable, specifically. NET Framework of what version is of little concern

Like mine is C:\Windows\Microsoft.NET\Framework\v4.0.30319.

Then add your C:\Windows\Microsoft.NET\Framework\v4.0.30319 to the WINDOWS system environment variable


2. Build your C # code snippet

Like E:\php\data\localweb , there's test.cs underneath.

Using system;using system.io;namespace Helloworld{public class Hello {static void Main ()         {StreamWriter SW = File.appe Ndtext ("test.txt"); int i;for (i=1; i<=10; i++) {sw. WriteLine (i); Console.WriteLine (i);} Sw. Flush (); Sw. Close ();             Console.WriteLine ("Run End.");            Console.readkey ();}}}        

3. Compiling your C # code snippet with the. NET CSC command


4. After successful execution, the Test.cs will be generated in your directory Test.exe

Double-click to run your Test.exe

Haha at this time you are debugging success! You can see the result of the code running!

Bonus:

The generated test.txt, if you want to count the contents of the test.txt, how many times different values appear, and in the order of many to few, here is the following code snippet for friendship:

<?php$temp = array_count_values (file (' Test.txt ', file_ignore_new_lines)); Arsort ($temp); Var_dump ($temp);



To PHP Programmers: Fast execution of C # code Snippets fast running C # code debugging C # C # write people file operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.