Run specific application from a Web Application - c#

I'm sure you all have seen those links are able to run for example Yahoo Messenger application on client side if it is installed on client machine. I want to know bit more about how should I register my protocol (I don't even know what should I call that) to open my specified application.
Please apologize As I don't know what should I tag this question, I tag it with very public tags.

This might be of help to you? :)
As far as i know it's called magnet links... :)
How do I make the website execute links?
Edit: Changed link to more appropriate...

Related

Connecting to a gallery without typing in page name

I'm working on a website where I have users view their gallery by typing in "www.example.com/mygallery" As of now they way I have this working is I create a virtual directory called "mygallery", and upload all the project files to it. This works well enough, but it's kind of clunky. Ideally what I would like to do is have the user type in the url (www.example.com/mygallery), and the website goes to "www.example.com/galllery.aspx?name=mygallery". That way there is no need to create a virtual directory for every user.
I have posted a similar question not too long ago about this, but I specifically said I wanted to use url rewriting to accomplish this goal, and did not get any responses. However I am open to any method of accomplishing this. So any help on this subject is greatly appreciated.
Thank you.
If your site isn't MVC, you can still use the RouteCollection mechanism to handle URL re-writing. Check this - http://msdn.microsoft.com/en-us/library/cc668177.aspx

Is it possible for someone to steal my source code for a ASP.NET web page?

I have a simple question in which I couldn't find an exact answer to, that question being:If I created an ASP.NET webpage, is it possible for someone to steal my C# source code?And if so, how can I protect my webpage's source code from being stolen/dumped/reverse engineered?
Please if you do know anything about this, as many replies as possible would be greatly appreciated! Thank you guys so very much, even if you just give me an idea on this topic! :)
Are you talking about a corporate user or a regular user?
Someone accessing your website from a web browser, like a standard user can not access your aspx/cs server side code. However if you are talking about a corporate user, if they browse to your web server and have access to your inetpub\wwwroot directory (or wherever your source resides) they have full read or maybe even write access. It all depends on the type of user, and the user security system in place for your domain, whether the person trying to get in is part of your domain and has proper privileges on your server. Also some client side scripts are exposed to user's as well.
So as far as server side scripts, users not part of your domain, and stringent security settings on your web server, are all factors contributing. But I think you mean in the context of a user just trying to access code from the web browser without any additional permissions. Which in this case would be no.
Not a complete answer but your C# code will be better protected if you use a Web Application rather than a Web Site. Your C# code will be compiled so even with an FTP access (or a direct access to the production server, if you suspect an inside threat), one won't be able to download your .cs files. Of course, one can download .dll and reverse engineer but that's something.
Read more about Web Apps vs Web Sites here : http://msdn.microsoft.com/en-us/library/dd547590.aspx
To the best of my knowledge there is not a way for someone to steal your asp code unless you allow them to see the file itself. If you view source you will see that the majority of the asp code has been changed either to html or javascript.
If I created an ASP.NET webpage, is it possible for someone to steal my C# source code?
Yes it is, there just to many ways how this can happen, vulnerability in the hosting environment, IIS exploit, your code allowing to download things etc. Just accept that your libraries (I assume they are compiled by the time you deploy) will be downloaded and protect them accordingly.
How can I protect my webpage's source code from being stolen/dumped/reverse engineered?
You cannot have an ultimate protection, but you may make life complicated for the person trying to reverse engineer it. Probably the most effective solution is to use code obfuscation. You may also want to read more general documentation on this topic, such as Design Guidelines for Secure Web Applications.

TcpListener HTTP file upload fails randomly

Background
I'm trying to implement a simple web server part as a web interface to a desktop application.
I first tried HTTPListener which worked but required admin privileges (in some way or another) which I felt was unnecessary. I'm now trying a TcpListener based approach.
Progress
Serving files works good but I'm having a problem with file uploads. I basically tried to use the answer found in another question but instead of plugging in HttpListenerContext.Request.InputStream I used TcpClient.GetStream().
Problem
The problem is that this seems to be working very randomly. Sometimes it works fine but most of the times it doesn't. When it doesn't work the thread doesn't seem to do anything until I press abort in my browser and it proceeds to throw an exception "Start boundary not found" (see the code in the link).
Question
Now, my questions are:
Am I doing this the right way or are there any simpler way to create an HTTP server (third-party libraries included)?
What could be the possible causes for my problem?
What parts of code would you need to see to help me further?
Cassini project is what you need. Also you can look at XSP in mono.
You should be able to embed those projects into your code and host ASP.NET. If that is not possible you can start looking XSP sources and implement the web server part yourself.

scraping/simulate browsing help

I want to make a program that will simulate a user browsing a site and clicking on links. Cookies and javascript have to be enabled. I've successfully done this in python, but I want to write it an compilable language (python ide's don't cut it). The links on the site are generated with javascript and are dynamic. With python I used PAMIE (third party module that uses win32com) to launch an instance of Internet explorer, scrape the generated html for the links, then navigate to one of them. The point is for the whole process to be transparent to the server. What's the best (compilable) language and method to do this? I was thinking C# with WebBrowser control but I don't want to spend a lot of time learning something if it isn't going to work. Any kind help is appreciated!
You might want to look at the automated testing via browser suites:
http://www.teknologika.com/blog/the-holy-grail-net-automated-web-gui-testing-for-internet-explorer/
http://watin.sourceforge.net/
I wrote a blog post on this awhile back: Web scraping in .NET. That discusses cookies but not JavaScript; I don't know if that would require additional coding.
Might be worth having a look at selenium .
We use it for web testing in a C# asp.net envirnorment.
The documentation isn't to bad

Asp.net webparts or portlet like functionality

What is the best way to let other parties use your website as their own content using their own style ?
We have build a small website for a customer, asp.net, .net framework 3.0. Now the customer wants other parties to be aple to use our website in their own websites while maintaining the styling of the costumers website.
I have done nothing like this before and don't even know what to google, so any help is appriciated.
I know you can do this with sharepoint, but to use sharepoint for such a small site seems like a lot of overkill
it sounds that portlets is a good name for what they want. but googling portlets draws me in the world of java and doesn't give me a lot of info on what the other parties would have to do to make it work.
a simple Iframe would probably take me a long way, but how can you get the styling done within an Iframe
webparts also sound interesting , but they seem more for in project sharing then letting people use them in their own site.
It is a small website and the logic and backend communication is pretty good contained, so a complete rework of the frond-end is not a big problem.
Once again, any help is appreciated !
Omar Al Zabir has a book on how to build a Portal in ASP.NET- here is a link to his Website.
You might want to look at his Dropthings portal.
Yes, portlets are pretty much Java-only, despite any talk of standards.
If you can encapsulate your pages in web parts or user controls, that would make it easy to style them, and even to parameterize them: a web part can be configured.
You can use Kalitte Dynamic Dashboards for creating professional dashboards and portlets.
More information can be found at www.dynamicdashboards.net

Categories