简体   繁体   中英

How do I import existing c# file into web application

I'm building a simple 1 page web interface that needs to be able to interact with a C# file I wrote as a "Universal Windows" application.

I'm new to .net and C#, is there any way to import the file so i have access to the methods or will I have to rewrite it in the web developer? Also, what is the best "web application" to use in visual studios to accomplish what I am trying to do?

Thanks.

If the file resides in the same project and different namespace then you can add the Using statement at the top of your code for the namespace in which your c# file resides. like :

using System.IO;

This will give access to all the public classes under the namespace System.IO.

You will need to use ASP.NET Web Application to achieve this. You can either choose web forms or MVC depending on your requirement.

Please visit ASP.NET Site for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM