本文整理汇总了C#中Record.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Record.Load方法的具体用法?C# Record.Load怎么用?C# Record.Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record.Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public bool Write(Dictionary<Guid,string> source, Adam.Core.Application app)
{
Record r = new Record(app);
Excel.Application EApp;
Excel.Workbook EWorkbook;
Excel.Worksheet EWorksheet;
Excel.Range Rng;
EApp = new Excel.Application();
object misValue = System.Reflection.Missing.Value;
EWorkbook = EApp.Workbooks.Add(misValue);
EWorksheet = (Excel.Worksheet)EWorkbook.Worksheets.Item[1];
EWorksheet.get_Range("A1", misValue).Formula = "UPC code";
EWorksheet.get_Range("B1", misValue).Formula = "Link";
Rng = EWorksheet.get_Range("A2", misValue).get_Resize(source.Count,misValue);
Rng.NumberFormat = "00000000000000";
int row = 2;
foreach(KeyValuePair<Guid,string> pair in source)
{
EWorksheet.Cells[row,1] = pair.Value;
r.Load(pair.Key);
Rng = EWorksheet.get_Range("B"+row, misValue);
EWorksheet.Hyperlinks.Add(Rng, r.Fields.GetField<TextField>("Content Url").Value);
//myExcelWorksheet.Cells[row, 2] = r.Fields.GetField<TextField>("Content Url").Value;
row++;
}
((Excel.Range)EWorksheet.Cells[2, 1]).EntireColumn.AutoFit();
((Excel.Range)EWorksheet.Cells[2, 2]).EntireColumn.AutoFit();
EWorkbook.SaveAs(_fileName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue,
Excel.XlSaveAsAccessMode.xlExclusive,
misValue, misValue, misValue, misValue, misValue);
EWorkbook.Close(true, misValue, misValue);
EApp.Quit();
return true;
}
示例2: Main
static void Main(string[] args)
{
Application app = new Application();
LogOnStatus status = app.LogOn("TRAINING", "Demidov", "123456");
Console.WriteLine(status);
if (status != LogOnStatus.LoggedOn)
{
throw new UnauthorizedAccessException();
}
Record rec = new Record(app);
Guid recId;
Guid.TryParse("46e678e9-24af-4364-8926-a54600dcf188", out recId);
rec.Load(recId);
string s = rec.Files.LatestMaster.Path;
Console.WriteLine(s);
Console.ReadLine();
}
示例3: GetByte64Image
private string GetByte64Image()
{
Record rec = new Record((Application) Session["AdamApp"]);
Guid recId;
Guid.TryParse("7819340e-b66c-4225-a604-a54500a909b2", out recId);
rec.Load(recId);
IReadOnlyImage prev = rec.Files.Master.GetPreview();
byte[] imagData = prev.GetBytes();
string imageDataString = Convert.ToBase64String(imagData);
return imageDataString;
}
示例4: GetFile
public FileContentResult GetFile()
{
Record rec = new Record((Application) Session["AdamApp"]);
Guid recId;
Guid.TryParse("7819340e-b66c-4225-a604-a54500a909b2", out recId);
rec.Load(recId);
IReadOnlyImage prev = rec.Files.Master.GetPreview();
return new FileContentResult(prev.GetBytes(), "image/jpeg");
}