Free webstorage that is accessible via code - c#

I have a desktop app for personal use and I would like it to be able to synchronize it's data with the net.
Since it's not trancational, I figured a solition migth be to (de)serialize the lot to a plain text format and store that in some file on the web.
Now I am looking for free storage in a way that I can access it via code, be it HTTP or FTP, that's all equal to me. Of course I would like it to 'steady', so not some obscure free service that can be stopped at any time without prior notice or services with bad connctions/ lots of downtime.
Also it would be nice if the data wasn't readily available for anyone who happens to google the right term, but that's optional since I can encrypt it.
I was thinking about google docs, but really anything will do as long as it is
free
steady (stable/trustworthy)
accessible via code
password protected (optional)
It would be very nice when codesnippets would come with the suggested solution!
I'm using C#

Softronics is a swiss hosting company that offers mydrive, a free 2GB WebDAV storage package.
They also host 2 Gigs of FTP for €1,20 a month

Some of the the Dropbox addons provide various Ruby, Python and PHP scripts and APIs for interacting with your storage space. I would probably start with the Ruby API and write a quick C# version if I were you.
If you do, can you publish it? :)

Not free, but pretty cheap - I use SugarSync. Just mark the local folder and it's automatically synched to the remote server. Version history and multi-machine sync too.

Related

Has anyone had success implementing maxmind's free GeoLiteCity DB on a C# webform?

We have several international partners/websites that have complained about their traffic being "stolen" by our domestic site (located in US). I thought it best to implement a free geoip service to offer a redirect option to our international users to their appropriate site if they happen upon our domestic site.
After researching the free options, I found that MaxMind offers a complete package with an option for fairly accurate IPaddress data (ipV4 and ipv6 included). In fact, our management strongly suggests the use of MaxMind's implementation.
I recently downloaded MaxMind's free GeoLiteCity.dat and github's C# code for my domestic website. I found the documentation to be quite vague as it relates to implementing their C# code on anything but a console application.
Before I implemented it on my current website - in my development environment, I successfully tested the implementation of the database, and the API on a console application and then successfully on a aspx page for a mock-website. I am currently experiencing dreaded "Object reference not set to an instance of an object" errors in my development environment.
I've added the class library for MaxMind and also added reference to that class library.
Has anyone run into issues implementing MaxMind's data while using C# code? Has anyone successfully utilized MaxMind's data and C# code on a webform? I would appreciate any insight. If you can provide a walkthrough of the implementation process and perhaps some sample C# code that works (or worked) for you, I would truly appreciate it.
I had to specify a full file system path to get it to read the database!! I may have missed something but relative path didn't work no matter what!!
var reader = new DatabaseReader(#"C:\Users\[User Name]\documents\visual studio 2013\Projects\glocalmvc\glocalmvc\Controllers\GeoLite2_City.mmdb", MaxMind.Db.FileAccessMode.Memory);
var omni = reader.Omni("1.1.1.1"); // replace it with a real ip address
after it worked, it didn't return city name, only country!! what a waste of time! :(

FTP a file in .net

I am looking to move a file from a directory on a server to a file share using a process running out that server already.
I want to know the best way to do this using the ftp protocol. My initial thoughts on how to do this were to use System.Net.FtpWebRequest... I will probably end up using this, but it looks like there may be some problems with it. To see what I mean check out the following link...'
See What I mean
That being said, in that article, he listed some other libraries that might be of use. Has anyone used any of these libraries? Would it be a good idea for me to try these out? Or should I just stick with FtpWebRequest. I will only be uploading a small file, and maybe it is not worth the time learning new libraries
If you are moving a file from a local server to a path accessible by network share from that server then there is no need to use FTP, you could just use File.Copy()
Personally I use the SSH.NET Library found over on Codeplex for its ability to use SFTP. You did not mention if security,encryption or compression was a requirement but this is a pretty tight little port over from java that runs in .NET 4.0
I've successfully used the FTPWebRequest on many projects without any problems. As long as you don't need implicit SSH functionality, .NET rocks!!
Here is a tutorial I've written on how to go about creating an FTP client in VB.NET:
http://dot-net-talk.blogspot.in/2008/12/how-to-create-ftp-client-in-vbnet.html
Here is the open-source library of an ftp client I've coded in C#:
http://libftp.codeplex.com/

SkyDrive as patcher storage server

As of late, we started a pretty large project (C# XNA game).
It seemed to be pretty obvious solution to store all the files in a remote server, use a database for file "versions" and have the patcher download the newer versions and delete any archaic.
Now this is all nice in theory, we even found a service with the space for it (SkyDrive with the 25GB offer).
The problem came up when it got to file manipulations.
We're looking for:
Can programmatically download/upoad (for the patch maker) files to/from SkyDrive.
Has a secure way of containing uname/pass.
Allow me to explain both.
Thing is, we had to make the SkyDrive on my personal account (due to the 25gb offer only being there for old users). I'm not very happy with someone getting my password, even though I'll obviously change it to something completely archaic, they would still get access to most of my other hotmail/msn related stuff. (I guess it's a reason to remake it all then?). So if possible I would secure the actual uname/pass inside the program. Since it's .NET and is compiled on demand, (and can easily be decompiled) I'm having doubts real security in this case is improbable (if it is possible to secure please do tell me how).
On top of that, there's no efficient&official SkyDrive API. This means that there's an even bigger security hole (see previous paragraph) and the communication won't necessarily work as expected). This also means there may be slowness in communication - something bad if you have 1000 users downloading the same file.
So to formulate all of this:
What is the the proper way (read API) to use SkyDrive as a storage server for a patcher considering it's linked to my personal account?
small sidenote, if I must, I can be evil and get our slow artist to host the server
Edit 1:
The idea is to have anyone be able to download the client, but initiating anything requires an active account on our database. As such the files themselves don't have a problem being read by everyone. So I'll add the following: how to programmaticaly get direct downloads from SkyDrive if the files are public? The current links lead to their web UI. And I mean programmatically (maybe during upload time) as to avoid doing it all by hand.
This is a bad idea.
Given #1:
Use a public folder to store your assets and grant everyone access to it
Use httpclient to download the files from the public folder anonymously in your patcher client
Use the SkyDrive descktop client to synchronize the public folder from a 'build' machine

Is there a solid .Net wrapper for the Managed Wifi Win32 API?

Has anyone developed (either as open source or as a reasonably-priced commercial offering) a .Net implementation of the Win32 Native Wifi API? Or does anyone here know of such a thing?
I've done about an hour and a half of spelunking on Google, MSDN, pinvoke.net and here, and haven't found anything. If I've missed something obvious, I apologize!
We're on a tight deadline, I know little about Wifi, and I need to get something running quickly. I can either cut 'n' paste from pinvoke.net, or write a .Net wrapper class in C++, but I'd prefer not to spend the time doing that, if possible.
What we need to do is poll continuously for the presence of a particular SSID; when it's seen, connect immediately and report to the client, who can then send some socket and/or SOAP messages, then advise us when it's safe to disconnect. We need to be able to report the signal strength to the client, as well ... it needs to make intelligent decisions about using Wifi vs. other communication modes available to it. For the first iteration, this can be unsecured, but we'll probably want to add the ability to specify a WEP key in the future.
Do the network management APIs that are wrapped up in the Code Pack help you? I believe you can get a .NET event when various things happen, and surely the availability of a specific SSID counts. I haven't done more than run the demo myself, but take a look. I think you'll like the license terms also - you're allowed to incorporate the library into your code.
UPDATE:
The given API, unfortunately, is no longer available. The link leads to the MSDN archives pages. Luckily, the answers here give links to the binaries of the aforementioned API.
There is Managed Wifi API but I haven't used it myself so I can't comment about it.

Light weight HTTP Server library in .NET

I'm looking for a small and fast library implementing an HTTP server in .NET
My general requirements are:
Supports multiple simultaneous connections
Only needs to support static content (no server side processing)
HTTP only, HTTPS not needed
Preferably be able to serve a page from an in memory source. I want to integrate it into another app to be able to make changing data available via a browser, but I don't want to have to write it to a file on disk first. For example, just pass it a C# string to use as the current page content.
Preferably open source so I can modify it if needed
Definitely needs to be free... it's for a personal project with no budget other than my own time. I also want to be able to release the final product that would use this library freely (even if that means complying to the particular OSS license of that library.
Edit: To clarify some more, what I need can be REALLY simple. I need to be able to serve essentially 2 documents, which I would like to be served directly from memory. And that's it. Yes, I could write my own, but I wanted to make sure I wasn't doing something that was already available.
Use Cassini.
Free, Open Source.
It would take trivial hacking to serve from memory.
Well, how complicated of a HTTP server do you need? .NET 2.0 has the HttpListener Class which you can use to roll your own basic library. Since this is for a personal project and you are willing to invest the time, it would also make for a good learning experience as you you would get to learn how to work with the class. Additionally, according to the MSDN documentation, it has an asynchronous mode that gives each request its own thread.
Getting a basic HTTP server with the class up and running isn't too difficult either, you should be able to get it done in only a couple hundred lines of code.
Check out Kayak.
Note: kayak doesn't seem to be maintained anymore - though it deserves to be so
LightHTTP is an open-source library I've created that does exactly what you need.
It can be used in testing and mocking, or other scenarios where a lightweight HTTP server is preferred.
It works asynchronously.
Supports simultaneous connections.
It can serve anyway you'd need, since it's based on HttpListener.

Categories