当前位置: 首页>>代码示例>>C#>>正文


C# SpreadsheetsService.setUserCredentials方法代码示例

本文整理汇总了C#中Google.GData.Spreadsheets.SpreadsheetsService.setUserCredentials方法的典型用法代码示例。如果您正苦于以下问题:C# SpreadsheetsService.setUserCredentials方法的具体用法?C# SpreadsheetsService.setUserCredentials怎么用?C# SpreadsheetsService.setUserCredentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Google.GData.Spreadsheets.SpreadsheetsService的用法示例。


在下文中一共展示了SpreadsheetsService.setUserCredentials方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GDataAPI

        public GDataAPI(NameValueCollection parameters)
        {
            try
            {
                SpreadsheetsService service = new SpreadsheetsService("post2spreadsheet");
                service.setUserCredentials(cardeira.Properties.Settings.Default.gUserName, cardeira.Properties.Settings.Default.gPassword);

                Google.GData.Spreadsheets.SpreadsheetQuery query = new Google.GData.Spreadsheets.SpreadsheetQuery();

                SpreadsheetFeed feed = service.Query(query);
                SpreadsheetEntry entry = null;
                foreach (SpreadsheetEntry e in feed.Entries)
                {
                    entry = e;
                    logger.Debug("Spreadsheet: {0}", entry.Title.Text);
                    if (entry.Title.Text == cardeira.Properties.Settings.Default.spreadsheetkey)
                        break;
                }
                if (entry != null)
                    InsertRow(service, (WorksheetEntry)entry.Worksheets.Entries[0], parameters);
            }
            catch (Exception e)
            {
                logger.ErrorException("error writing to spreadsheet", e);
            }
        }
开发者ID:jcardeira,项目名称:Post2Spreadsheet,代码行数:26,代码来源:GoogleDataAPI.cs

示例2: GoogleNinjaService

        public GoogleNinjaService(ISpreadsheetConfiguration googleSpreadsheetConfiguration)
        {
            this.googleSpreadsheetConfiguration = googleSpreadsheetConfiguration;

            service = new SpreadsheetsService("tretton37-NinjaBook");
            service.setUserCredentials(googleSpreadsheetConfiguration.Username, googleSpreadsheetConfiguration.Password);
        }
开发者ID:orjan,项目名称:NinjaBone,代码行数:7,代码来源:GoogleNinjaService.cs

示例3: AuthenticateGoogleUser

        private SpreadsheetsService AuthenticateGoogleUser(string val)
        {
            SpreadsheetsService service = new SpreadsheetsService("NodeLookupProgram");
            service.setUserCredentials(ConfigurationManager.AppSettings["username"].ToString(), ConfigurationManager.AppSettings["passcode"].ToString());

            return service;
        }
开发者ID:EEREweb,项目名称:CMS-MigrationUtility,代码行数:7,代码来源:GoogleLookup.cs

示例4: getWorksheetList

        //Fetch all worksheets for given Spreadsheet
        public static ArrayList getWorksheetList(string userName, string passWord, string spreadSheetName)
        {
            ArrayList worksheetList = new ArrayList();

            SpreadsheetsService service = new SpreadsheetsService(spreadSheetName + "Service");

            //You could set it up from DB or config file also. This is not a reccomended way. Just an easy way to show fetching
            service.setUserCredentials(userName, passWord);

            SpreadsheetQuery query = new SpreadsheetQuery();

            SpreadsheetFeed feed = service.Query(query);

            foreach (SpreadsheetEntry entry in feed.Entries)
            {
                if (entry.Title.Text == spreadSheetName)
                {
                    AtomLink link = entry.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null);

                    WorksheetQuery wquery = new WorksheetQuery(link.HRef.ToString());
                    WorksheetFeed wfeed = service.Query(wquery);

                    foreach (WorksheetEntry worksheet in wfeed.Entries)
                    {
                        worksheetList.Add(worksheet.Title.Text);
                    }
                }
            }

            return worksheetList;
        }
开发者ID:Neuralab,项目名称:Net-Neuralab-Utilities,代码行数:32,代码来源:GoogleAppsSpreadsheetUtils.cs

示例5: SpreadSheet

        public SpreadSheet()
        {
            service = new SpreadsheetsService("stock-market");
            service.setUserCredentials("shurai", "$gva99void!");

            SpreadsheetQuery query = new SpreadsheetQuery();
            SpreadsheetFeed feed = service.Query(query);

            SpreadsheetEntry ssentry = (SpreadsheetEntry)feed.Entries[0];

            AtomLink sslink = ssentry.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null);
            WorksheetQuery wkquery = new WorksheetQuery(sslink.HRef.ToString());
            WorksheetFeed wkfeed = service.Query(wkquery);
            WorksheetEntry wkentry = (WorksheetEntry)wkfeed.Entries[0];

            listFeedLink = wkentry.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
            listQuery = new ListQuery(listFeedLink.HRef.ToString());
            listFeed = service.Query(listQuery);

            Console.WriteLine("Worksheet has {0} rows: ", listFeed.Entries.Count);
            foreach (ListEntry worksheetRow in listFeed.Entries)
            {
                ListEntry.CustomElementCollection elements = worksheetRow.Elements;
                foreach (ListEntry.Custom element in elements)
                {
                    Console.Write(element.Value + "\t");
                }
                Console.WriteLine();
            }
        }
开发者ID:carrotderek,项目名称:CPSC581-TwoFacedBull,代码行数:30,代码来源:SpreadSheet.cs

示例6: AllCells

        public ActionResult AllCells()
        {
            SpreadsheetsService service;

            service = new SpreadsheetsService("DevFestEvent");
            service.setUserCredentials(
                ConfigurationManager.AppSettings["GoogleUser"],
                 ConfigurationManager.AppSettings["GoogleUserPassword"]);
            SpreadsheetQuery q = new SpreadsheetQuery(App.SheetFeedData);
            var feed = service.Query(q);
            AtomLink l = feed.Entries.First().Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null);
            WorksheetQuery query = new WorksheetQuery(l.HRef.ToString());
            WorksheetFeed f = service.Query(query);

            foreach (var item in f.Entries)
            {
                AtomLink cellFeedLink = item.Links.FindService(GDataSpreadsheetsNameTable.CellRel, null);
                var cellfeedlink = cellFeedLink.HRef.ToString();

                CellQuery cquery = new CellQuery(cellfeedlink);
                CellFeed cfeed = service.Query(cquery);

                Console.WriteLine("Cells in this worksheet:");
                uint rownum = 2;

                foreach (CellEntry curCell in cfeed.Entries)
                {
                    rownum = curCell.Cell.Row;
                }
            }
            return View(f);
        }
开发者ID:processnotproduct,项目名称:DevFestEvent-MVC,代码行数:32,代码来源:SpreadsheetController.cs

示例7: GoogleClient

        public GoogleClient(TrelloStatsConfiguration configuration)
        {
            _configuration = configuration;
            _service = new SpreadsheetsService("trelloStats");
            _service.setUserCredentials(_configuration.GmailEmailAddress, _configuration.GmailPassword);

            _configuration = configuration;
        }
开发者ID:kareem613,项目名称:TrelloStats,代码行数:8,代码来源:GoogleClient.cs

示例8: SpreadsheetProxy

        public SpreadsheetProxy(Credentials credentials)
        {
            spreadsheetService = new SpreadsheetsService("groundfloor-svc1");
            spreadsheetService.setUserCredentials(credentials.username, credentials.password);

            documentService = new DocumentsService("groundfloor-svc2");
            documentService.setUserCredentials(credentials.username, credentials.password);
        }
开发者ID:keith9820,项目名称:Groundfloor,代码行数:8,代码来源:Spreadsheet.cs

示例9: DatabaseClient

		public DatabaseClient(string username, string password) {
			var docService = new DocumentsService("database");
			docService.setUserCredentials(username, password);
			documentService = docService;

			var ssService = new SpreadsheetsService("database");
			ssService.setUserCredentials(username, password);
			spreadsheetService = ssService;
		}
开发者ID:Ariequ,项目名称:Unity-GoogleData,代码行数:9,代码来源:DatabaseClient.cs

示例10: GetWords

        public IEnumerable<Word> GetWords()
        {
            if (Enabled)
            {
                SpreadsheetsService GoogleService = new SpreadsheetsService("LanguageBooster");

                // FIX ME: Remove credentials from code.
                GoogleService.setUserCredentials("xxx", "xxx");

                SpreadsheetQuery SpreadsheetsQuery = new SpreadsheetQuery();
                SpreadsheetFeed Spreadsheets = GoogleService.Query(SpreadsheetsQuery);

                // Get list of spreadsheets
                foreach (SpreadsheetEntry WordsSheet in Spreadsheets.Entries)
                {
                    System.Diagnostics.Trace.WriteLine(WordsSheet.Title.Text);

                    System.Diagnostics.Trace.WriteLine(WordsSheet.Title.Text);

                    // Get list of worksheets from spreadsgett
                    WorksheetFeed Worksheets = WordsSheet.Worksheets;

                    WorksheetEntry CurrentWorksheet = null;
                    foreach (WorksheetEntry Worksheet in Worksheets.Entries)
                    {
                        CurrentWorksheet = Worksheet;
                        break;
                    }

                    AtomLink CellsLink = CurrentWorksheet.Links.FindService(GDataSpreadsheetsNameTable.CellRel, null);
                    CellQuery CellsQuery = new Google.GData.Spreadsheets.CellQuery(CellsLink.HRef.ToString());
                    CellFeed Cells = GoogleService.Query(CellsQuery);

                    Word word = null;
                    // Load actual table data
                    foreach (CellEntry CurrentCell in Cells.Entries)
                    {
                        if (CurrentCell.Column == 1)
                        {
                            word = new Word();
                            word.Question = CurrentCell.Value;
                        }

                        if (CurrentCell.Column == 2)
                        {
                            word.Answer = CurrentCell.Value;
                            System.Diagnostics.Trace.WriteLine(word.Question + " - " + word.Answer);
                            yield return word;
                        }
                    }
                }
            }
        }
开发者ID:BujakiAttila,项目名称:LanguageBoosterGame,代码行数:53,代码来源:GetGoogleSheetData.cs

示例11: SpreadsheetManager

		public SpreadsheetManager( string userName, string password, string applicationName, string clientId, string clientSecret, string redirectUri, string scope )
		{
			oAuthParams = new OAuth2Parameters()
			{
				ClientId = clientId,
				ClientSecret = clientSecret,
				RedirectUri = redirectUri,
				Scope = scope
			};

			_spreadsheetsService = new SpreadsheetsService( applicationName );
			_spreadsheetsService.setUserCredentials( userName, password );
		}
开发者ID:RayBatts,项目名称:pwnsaw,代码行数:13,代码来源:GoogleSpreadsheet.cs

示例12: Index

        //
        // GET: /Spreadsheet/
        public ActionResult Index()
        {
            SpreadsheetsService service;

            service = new SpreadsheetsService("Spreadsheet-GData-Sample-App");
            service.setUserCredentials(
                ConfigurationManager.AppSettings["GoogleUser"],
                 ConfigurationManager.AppSettings["GoogleUserPassword"]);

            SpreadsheetQuery query = new SpreadsheetQuery();
            var feed = service.Query(query);

            return View(feed);
        }
开发者ID:processnotproduct,项目名称:DevFestEvent-MVC,代码行数:16,代码来源:SpreadsheetController.cs

示例13: WatchNotify

        public WatchNotify(string googleUserName, string googlePassword, IEmailService mailService)
        {
            if (String.IsNullOrEmpty(googleUserName) || String.IsNullOrEmpty(googlePassword))
                throw new ArgumentException("Please provide google credentials");

            GoogleUserName = googleUserName;
            GooglePassword = googlePassword;

            MySpreadsheetService = new SpreadsheetsService("AuctionWatchNotify");
            MySpreadsheetService.setUserCredentials(GoogleUserName, GooglePassword);

            if (!mailService.CheckConnection())
                throw new ArgumentException("Please pass in a working email service account");

            MyEmailService = mailService;
        }
开发者ID:TheJeremyGray,项目名称:FileWatcherService,代码行数:16,代码来源:WatchNotify.cs

示例14: LogInButton_Click

        private void LogInButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SpreadsheetsService service = new SpreadsheetsService("dyselon-cardmaker-v1");
                service.setUserCredentials(this.Username.Text, this.Password.Password);
                Service = service;
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("Failed to log in with error:\n\n{0}", ex.ToString()));
                return;
            }

            this.DialogResult = true;
            this.Close();
        }
开发者ID:dyselon,项目名称:cscribe,代码行数:17,代码来源:LoginWindow.xaml.cs

示例15: CSS

        public ContentResult CSS()
        {
            SpreadsheetsService service;

            service = new SpreadsheetsService("DevFestEvent");
            service.setUserCredentials(
                ConfigurationManager.AppSettings["GoogleUser"],
                 ConfigurationManager.AppSettings["GoogleUserPassword"]);
            var cellfeedlink = App.SheetFeedCSS;
            CellQuery cquery = new CellQuery(cellfeedlink);
            CellFeed cfeed = service.Query(cquery);
            string ans = "";

            foreach (CellEntry curCell in cfeed.Entries)
            {
                ans += curCell.Cell.Value;
            }
            return Content(ans, "text/css");
        }
开发者ID:processnotproduct,项目名称:DevFestEvent-MVC,代码行数:19,代码来源:SpreadsheetController.cs


注:本文中的Google.GData.Spreadsheets.SpreadsheetsService.setUserCredentials方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。