Ta bort (0) från families och kör med [0] eftersom den retunerar en collection.
Frågan#1
varför fungerar den överska koden (VB) men inte den nedersta (C#)?
Dim privateFontCollection As New PrivateFontCollection()
privateFontCollection.AddFontFile(Server.MapPath("BAMBOO.TTF"))
Dim thisFont As FontFamily = privateFontCollection.Families(0)
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(Server.MapPath("BAMBOO.TTF"));[red]
FontFamily thisFont = pfc.Families(0);[/red]
får följande fel om jag kör den nedersta:
'System.Drawing.Text.FontCollection.Families' denotes a 'property' where a 'method' was expected