Skip to content

Commit

Permalink
统一pull、push格式
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeric-X committed May 19, 2017
1 parent 81a3ace commit edc4ea3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions SyncClipboard/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ static class Program
{
public static String SoftName = "SyncClipboard";
public static String DefaultServer = "https://cloud.jericx.xyz/remote.php/dav/files/Clipboard/Clipboard/";
public static String DefaultUser = "ClipBoard";
public static String DefaultPassword = "ClipBoard";
public static String DefaultUser = "Clipboard";
public static String DefaultPassword = "Clipboard";
public static MainForm mainForm;

/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions SyncClipboard/SyncService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,18 @@ public void PushLoop()
}
public void PushToRemote(String str)
{
//ConvertJsonClass convertJson = new ConvertJsonClass();
//convertJson.File = "Windows";
//convertJson.Clipboard = str;
//JavaScriptSerializer serializer = new JavaScriptSerializer();
//string jsonString = serializer.Serialize(convertJson);
ConvertJsonClass convertJson = new ConvertJsonClass();
convertJson.File = "";
convertJson.Clipboard = str;
JavaScriptSerializer serializer = new JavaScriptSerializer();
string jsonString = serializer.Serialize(convertJson);

String url = Config.Url;
String auth = "Authorization: Basic " + Config.Auth;
HttpWebResponse httpWebResponse = null;
try
{
httpWebResponse = HttpWebResponseUtility.CreatePutHttpResponse(url, str, Config.TimeOut, null, auth, null, null);
httpWebResponse = HttpWebResponseUtility.CreatePutHttpResponse(url, jsonString, Config.TimeOut, null, auth, null, null);
}
catch(Exception ex)
{
Expand Down

0 comments on commit edc4ea3

Please sign in to comment.