업데이트 시간에 따라 서버 기반 파일 (PDF)을 다운로드하려고합니다 (데이터베이스에 저장 됨).
두 파일 모두 주어진 "ITEMS"개체에서 파싱 된 json 기반 파일입니다. C#으로 Visual Studio 2015를 사용하고 있습니다. 백엔드는 Laravel REST입니다.
class Items
{
public int id { get; set; }
public string branch { get; set; }
public string item { get; set; }
public string link { get; set; }
public int active { get; set; }
public string created_at { get; set; }
public string updated_at { get; set; }
}
이 내가 서버와 로컬 목록 (모두 JSON) 구문 분석하고 어떻게 다음 updated_at 필드가
// Compare files
foreach (Items item in files)
{
foreach(Items it in filesToDownload)
{
if (!it.updated_at.Equals(item.updated_at))
{
//Download the file
//Create a new list of files to download
}
}
}
같거나하지 않으면 내가 확인하는 foreach 루프를 사용하고
for (int i = 0; i < obj.Count; i++)
{
JObject row = JObject.Parse(obj[i].ToString());
Items newItem = new Items();
newItem.id = int.Parse(row["id"].ToString());
newItem.branch = row["branch"].ToString();
newItem.item = row["item"].ToString();
newItem.link = row["link"].ToString();
newItem.created_at = row["created_at"].ToString();
newItem.updated_at = row["updated_at"].ToString();
files.Add(newItem);
}
을
예. 수정 됨. –