내 프로젝트에서 코드 숨김으로 asp.net을 사용하여 C#으로 GOOGLE DOCS를 사용하려면 어떻게해야합니까?asp.net 응용 프로그램에서 Google 워드 프로세서 사용
기본적으로 일부 pdf, doc, dox는 브라우저의 읽기 전용 양식으로 문서를 표시해야합니다.
미리 감사드립니다.
내 프로젝트에서 코드 숨김으로 asp.net을 사용하여 C#으로 GOOGLE DOCS를 사용하려면 어떻게해야합니까?asp.net 응용 프로그램에서 Google 워드 프로세서 사용
기본적으로 일부 pdf, doc, dox는 브라우저의 읽기 전용 양식으로 문서를 표시해야합니다.
미리 감사드립니다.
Google 문서에는 API가 있습니다.
Google 문서 목록 데이터 API를 사용하면 클라이언트 응용 프로그램에서 프로그래밍 방식으로 에 액세스하고 Google 문서와 함께 저장된 사용자 데이터를 조작 할 수 있습니다.
documentation을 확인하십시오. 예제와 Google 워드 프로세서를 기반으로 개발해야 할 모든 것이 있습니다.
using System;
using System.IO;
using System.Net;
using Google.Documents;
using Google.GData.Client;
namespace Google
{
class Program
{
private static string applicationName = "Testing";
static void Main(string[] args)
{
GDataCredentials credentials = new GDataCredentials("[email protected]", "password");
RequestSettings settings = new RequestSettings(applicationName, credentials);
settings.AutoPaging = true;
settings.PageSize = 100;
DocumentsRequest documentsRequest = new DocumentsRequest(settings);
Feed<document> documentFeed = documentsRequest.GetDocuments();
foreach (Document document in documentFeed.Entries)
{
Document.DownloadType type = Document.DownloadType.pdf;
Stream downloadStream = documentsRequest.Download(document, type);
Stream fileSaveStream = new FileStream(string.Format(@"C:\Temp\{0}.pdf", document.Title), FileMode.CreateNew);
if (fileSaveStream != null)
{
int nBytes = 2048;
int count = 0;
Byte[] arr = new Byte[nBytes];
do
{
count = downloadStream.Read(arr, 0, nBytes);
fileSaveStream.Write(arr, 0, count);
} while (count > 0);
fileSaveStream.Flush();
fileSaveStream.Close();
}
downloadStream.Close();
}
}
}
}