因此,如果您在开发环境中安装 Neo4j,您将拥有 Neo4Jserver 的本地托管版本,通常您可以通过以下方式浏览:localhost:7474/db/data。
你的代码是这样的:
var client = new GraphClient(new Uri("http://localhost:7474/db/data"));
client.Connect();
但是,有一天您会想要连接到基于云的 Neo4J 服务器(Heroku、Azure 等)。当然,这意味着您必须提供网络凭据。如果你只用你的双手,它可能是这样的:
var http = (HttpWebRequest)WebRequest.Create(new Uri("http://<<your_REST_query"));
var cred = new NetworkCredential("yourusername", "yourpassword");
http.Credentials = cred;
var response = http.GetResponse();
var stream = response.GetResponseStream();
但是如何包含网络凭据以连接 Neo4JClient?还是有其他我不知道的选择?