Wednesday, February 16, 2011

NekoDrive projects moving to .net 4.0

All the NekoDrive projects are now using .net 4.0. Soon I will start the development for NFS 4.1 support and refactor the API.

Thursday, July 15, 2010

Free Windows NFS Client

If you need a free NFS windows client that works on windows (7/Vista/XP/2003 - x32 and x64) you can download a free nfs client that I made time ago in order to test nekodrive's nfs libraries.
It's very basic but it works pretty well and supports NFS v2 and v3.
It's just an exe file and a couple of dll, you don't need to install this software.

check this out here http://nekodrive.googlecode.com/files/NfsTestClient.zip

Thursday, May 13, 2010

Using DotRas

In those days I'm trying to use DotRas library in my WPF project. DotRas is a fantastic library that let you create and use a RAS/VPN connection.. In my scenario I have one application that has to activate a 3G connection (using an USB modem )in order to contact a WCF data service.
I downloaded DotRas 1.1 from the official codeplex website (dotras.codeplex.com) and I added a reference on my WPF app.. The code is quite simple:

using DotRas;

....

RasDialer dialer;

private void Connect()
{
dialer = new RasDialer();
dialer.PhoneBookPath = @"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk";
dialer.EntryName = "TEST";
dialer.Dial();
}

Before start the program you have to create the PhoneBookEntry double clicking on rasphone.pbk or in XP Start-->Settings-->Control Panel-->Network Connection:
  • create a New Connection
  • Select the Connect to the Internet --> Next
  • Select Set up my connection manually --> Next
  • Select Connect using a dial-up modem --> Next
  • Select the modem to be used --> Next
  • Type the ISP name that must be the dialer.EntryName --> Next
  • Type the Phone number depending on your ISP. For the provider I'm using is *99# --> Next
  • Fill the account information depending on your ISP --> FINISH!
DotRas can also help to create the network connection programmatically in the code, but in my case I don't need this..

NFS client c# library 0.4.2.3

You can separately download the open source NFS client c# library 0.4.2.3 here:

http://nekodrive.googlecode.com/files/NFSClientCSharp_0_4_2_3.zip

This library is under LGPL license.

Wednesday, May 12, 2010

How to use the NFS Client c# Library

I add a wiki page that explains how to use the NFS Client c# .net library in your project.

NekoDrive uses a Library written in C# on .NET 2.0. that wraps the C++ NFS implementation. In order to use this library in your project download NekoDrive and copy in your project NekoDrive.NFS.dll, NFSv2.dll and NFSv3.dll. Add a reference in your project to NekoDrive.NFS.dll. Don't forget to include NFSv2.dll and NFSv3.dll as a content to deploy.

you download this library here:

http://code.google.com/p/nekodrive/

Example 1 - Connect to NFS server and get the exported devices

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using NekoDrive.NFS;
using NekoDrive.NFS.Wrappers;


namespace Example1
{
class Program
{
static void Main(string[] args)
{
using(NFS nfs = new NFS(NFS.NFSVersion.v2))
{
if (nfs.Connect(IPAddress.Parse("161.55.201.250")) == NFSResult.NFS_SUCCESS)
{
foreach(string device in nfs.GetExportedDevices())
Console.WriteLine(device);
nfs
.Disconnect();
}
}
}
}
}

Example 2 - Connect to NFS server, mount the first exported device and get the file list

namespace Example2
{
class Program
{
static void Main(string[] args)
{
using(NFS nfs = new NFS(NFS.NFSVersion.v2))
{
if (nfs.Connect(IPAddress.Parse("161.55.201.250")) == NFSResult.NFS_SUCCESS)
{
List devices = nfs.GetExportedDevices();
if(devices.Count > 0)
{
if(nfs.MountDevice(devices[0]) == NFSResult.NFS_SUCCESS)
{
foreach(string item in nfs.GetItemList())
{
NFSAttributes attrib = nfs.GetItemAttributes(item);
Console.WriteLine(item + " " + attrib.cdateTime.ToString() + " " + attrib.size);
}
nfs
.UnMountDevice();
}
}
nfs
.Disconnect();
}
}
}
}
}

Example 3 - Connect to NFS server, mount the first exported device and download a file in the root folder (.)

namespace Example3
{
class Program
{
static void Main(string[] args)
{
using(NFS nfs = new NFS(NFS.NFSVersion.v2))
{
if (nfs.Connect(IPAddress.Parse("161.55.201.250")) == NFSResult.NFS_SUCCESS)
{
List devices = nfs.GetExportedDevices();
if(devices.Count > 0)
{
if(nfs.MountDevice(devices[0]) == NFSResult.NFS_SUCCESS)
{
if(nfs.Read("test.txt", ".", @"c:\test.txt") != NFSResult.NFS_SUCCESS)
Console.WriteLine(nfs.GetLastError());
nfs
.UnMountDevice();
}
}
nfs
.Disconnect();
}
}
}
}
}

Example 4 - Connect to NFS server, mount the first exported device and upload a file in the "test/sub" subfolder

namespace Example4
{
class Program
{
static void Main(string[] args)
{
using(NFS nfs = new NFS(NFS.NFSVersion.v2))
{
if (nfs.Connect(IPAddress.Parse("161.55.201.250")) == NFSResult.NFS_SUCCESS)
{
List devices = nfs.GetExportedDevices();
if(devices.Count > 0)
{
if(nfs.MountDevice(devices[0]) == NFSResult.NFS_SUCCESS)
{
if(nfs.Write("test.txt", "test/sub", @"c:\test.txt") != NFSResult.NFS_SUCCESS)
Console.WriteLine(nfs.GetLastError());
nfs
.UnMountDevice();
}
}
nfs
.Disconnect();
}
}
}
}
}

Saturday, May 8, 2010

What is NekoDrive

The target of this project is to implement NFS (Network File System v2/v3/v4.1) over the Dokan user file system for windows. This let you mount very easily an NFS export as a local windows drive. You don't need any NFS windows client to access the NFS remote export, you can just use microsoft explorer.
NekoDrive makes Mounting NFS Linux shares very easy, and it's free!

NekoDrive 0.4.0.1

A new version of NekoDrive is out:
  • now you can set your own label on the mounted NFS drive

http://nekodrive.googlecode.com/files/NekoDrive_0_4_0_1_x86.zip