How do I convert a desktop webscraper to a website? - c#

I have a desktop webscraper application written using C#.NET.
It works very simply. The user imports input data in txt/csv/Excel. The app exports scraped and orginized results in an output file (csv, html).
How can I make this accessible online, as a website?
I haven't done web programming before (only desktop) and I do not know any web programming languages. But I think I can learn ASP.NET and create similar webscraper functionality with it.
What kind of webhosting requirements do I have?

What you need to do is turn your desktop application into a library. Turn your EXE into a DLL with an API that does specific functions. This means separating functional operations from UI operations. Then, build a web application that uses this library to offer the same functionality online.
If you want to learn something new to build web applications, I suggest ASP.NET MVC and not ASP.NET Web Forms. MVC is much closer to web development than web forms.
As for web hosting requirements, Any web host that support ASP.NET should be able to run ASP.NET MVC.

I have done a little with ASP.NET but I think this will help you

Related

How to create Razor pages web app + web service

I'm mostly back end developer and want to start small side project.
I want to do razor pages web app and as a part of it I would like to have web api that can be consumed outside of the app and if I want, use it to build other front end with it.
What would be good project structure? I don't want to have it deployed as 2 apps. One for razor, second for web API. I would like to have it as a one deployed app.
Is this good approach?
Thanks
I tried separate razor pages app and separate web api. Deployed as two pages.
Since you're building a Web API project anyway, you should consider making a frontend application with a framework like Vue that interacts with the API, instead of a Razor project. Having both a Razor project and a Web API project would be redundant as both of them would have to incorporate most of the same backend code.
It better separates the role of the frontend and backend applications, and Microsoft's documentation suggests using this project structure too.
You'd have to deploy two separate apps, but this would be a more suitable approach.
If you still want to deploy one application only, you could just incorporate Web API services in your Razor app, but this really isn't recommended.

C# Winform and ASP.Net and Xamarin

Right now, I'm in C# Winform and I would like to use my Windows Application with ASP.NET including with Xamarin. So, I need to know, what kind of program do people often use to make application run in all kind of devices (Computer + Web Browser + Smartphone)? And what should I use, WPF or UWP or which one?
This question is a bit broad/unclear, but you could consider porting your app to an ASP.NET frontend, and then load it with a wrapper on mobile phones and desktops.
Essentially create native apps that in turn load the ASP.NET web app. This is a quite common approach as it reduces development time.
If I understand you clearly, you want to make an ASP.NET Core application.
That is an webapp and if you use bootstrap it will scale on every device.
And because you use Core, you can host the webapp on every server (windows, linux etc.)

ASP.net for desktop application?

I was talking with a friend the other day, and he was saying to me that it is able to create desktop based software in ASP.net. With what I know, ASP.net is only for web-pages. I made few searches around the google, and most of the results say it is a web designing page. But there was many others who said it can, but need to use 3rd party desktop or something..
So, I am asking here to get a better answer. Is it possible to create a computer based software in ASP.net?
you can create a desktop app (with WPF for example) that has a WebBrowser control to host your asp.net site.
but yes, asp.net is at the end a web technology.
read more about: https://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser(v=vs.110).aspx
In theory it is possible. You run a web server and get a browser shell to communicate with the web server on localhost. This is of course stupid but possible. Also he is probably talking about .NET, not ASP.NET which makes much more sense because the desktop frameworks for .NET are pretty good for desktop development.

ASP.NET 5 and Silverlight 5

I am building simple LOB application (online restaurant reservation application) and i want to support multiple client side application types like web site, windows desktop application, android application etc. So i think that best way to design system is to separate ASP.NET 5 WebApi which will provide interaction with database, authorization and stuff like that and than build separate solution with projects for client applications which will consume that API. One of those client applications would be Silverlight application. Problem is, how i consume my API from Silverlight application. I can't find any information to link Silverlight with ASP.NET 5. All i got isMVC6. Is it better to createASP.NET MVC6application, implement my APIs there and hostSliverlight` in that project or to separate it like i described?
Silverlight is dead, but it can easily consume REST API so why cannot it work with ASP.NET Core 1.0?
There is no need to have special documentation.

How can I publish a web page from a Windows Forms application? (C#)

I wish to build a Windows application that will generally run in the background, but have a configurable front-end Windows Forms GUI. I also would like this program to publish a small web page which can be accessed from other machines/devices and interact or call functions of the server application.
I'd rather not deploy a full-fledged ASP.NET web site with IIS, etc. I just need something simple.
So how would I go about doing this?
Take a look at Kayak. It's a relatively small and lightweight HTTP server that you can embed into your application and should provide all the functionality you're looking for.
FWIW, I am in no way associated with this project.
Maybe it's just because i've been doing asp dev for years, but I really think you should go the iis asp route as its very simple and built into windows. I can't imagine a more straightforward way of serving a webpage that has c# behind it to programmatically effect the host system.
Thanks to Kev in the comments on my question, he pointed me to this question, in which I found a link to a lightweight C# HTTP server component I could just drop in to my application: http://webserver.codeplex.com/
Works well for little stuff like I was doing.

Categories

Resources