The code is as follows:
The namespace interfaceclass
{
Class Program
{
The static void Main (string [] args)
{
HSSFWorkbook wb=new HSSFWorkbook ();
ISheet sh=wb. CreateSheet (" zhiyuan ");
HSSFHyperlink link1=new HSSFHyperlink (HyperlinkType. File);
Link1. Address=@ "D: \ \ file \ \ automation \ \ measurement JPG";
IRow row3=sh. CreateRow (3);
int n=0;
For (n=0; n <4. N++)
{
ICell cell4=row3. CreateCell (n + 1);
Cell4. SetCellValue (n);
Cell4. The Hyperlink. Address=@ "D: \ \ file \ \ automation \ \ measurement JPG";
}
Using (FileStream STM=File. OpenWrite (@ "mylink. XLS"))
{
Wb. Write (STM);
The Console. Write (" OK ");
}
}
}
}
CodePudding user response: