|
Hi Anyone.
Is there a way to save and reterive system.font in sql Databse?
sepel
|
|
|
|
|
There is no such class. Do you mean the System.Drawing.Font class?
You can't save objects in the database. Save the information that you need to recreate the Font object.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: There is no such class. Do you mean the System.Drawing.Font class?
yes i want to save a font for each control (for example: textbox).
i think there should be a solution for it .as same as we save image or file in database.
sepel
|
|
|
|
|
You can save font as string and read it later as an object using FontConverter.
I've used the following code before to serialize font.
private Font _font;
public string FontString {
get { return _font.Name + ", " + _font.SizeInPoints + "pt, " + "style=" + _font.Style; }
set { _font = (Font)new FontConverter().ConvertFromString(value); }
}
|
|
|
|
|
tnx Lazy_Monk .It seem to be good idea for save font.
Do you have any idea if we have another object that may be have more properties?
sepel
|
|
|
|
|
The principle is the same. You have to serialise it into something that you can save as an independent chunk of data.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
sepel wrote: yes i want to save a font for each control (for example: textbox).
i think there should be a solution for it .as same as we save image or file in database.
You can neither save images nor files in a database. An images is converted into a byte array before it's saved in the database. The contents of the file is read as a byte array before it's saved in the database.
It's the same with a Font object. You can't save the object in the database, you have to take the information from the object and package as data that can be saved in the database.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
While writing to an excel file(Console Application), a message box appears 'Do you want to save the changes ..........'. How can i avoid this type of popup windows while writing to?
|
|
|
|
|
Try this
Excel.Application eApp = new Excel.Application();
eApp.DisplayAlerts = false;
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello
When try to send a ref of array string to the variant pointer we get DISP_E_TYPEMISMATCH exception.
Eg:
MFC App is OLE Automation enabled.
void Funct1(VARIANT *pVar)
from C# side we invoke this as follows
string [] str = new string[100];
Object obj = (Object) str;
mfcAutoApp.Funct1(ref obj);
Any suggestions on this...
-thanks
|
|
|
|
|
Any suggestions...???
|
|
|
|
|
Resolved the issue using VariantClass helps things work smoothly...thanks for all your time.
|
|
|
|
|
Is there a method to create a new font,which we can define the ratio of font height and width?
like the font in autoCad.
from vevi
|
|
|
|
|
I use the GraphicsPath's drawString method.
and use the Matrix to set the font's ratio of height and width.
...it can do it,but too complex to implement.
is there a simple method to implement it ?
from vevi
|
|
|
|
|
I have a pointer to a struct. In C++ I can allocate and deallocate it but in C#, I can't. Could you give me a solution plz !
|
|
|
|
|
For example I have a struct like this :
public unsafe struct V
{
unsafe public V* backpointer;
};
When I declare :
V n = new V();
n.backpointer = &x
in a loop then the previous value of backpointer changed.
Could you plz help me ?
modified on Sunday, October 5, 2008 9:50 PM
|
|
|
|
|
I think that the garbage collector deallocated the memory. How can we stop it plz ?
|
|
|
|
|
hockymot2008_2009 wrote: I think that the garbage collector deallocated the memory.
No, it didn't, as you never allocated any memory from the heap.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hockymot2008_2009 wrote: V n = new V();
That doesn't do what you think that it does. As the struct is a value type, you are not allocating memory for an object, you are just creating a struct value. The value is assigned to the struct n, and will overwrite the previous value in the struct.
Is there any reason why you are trying to use structs instead of classes and pointers instead of references?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Use the fixed[^] keyword. More about unsafe code[^].
By the way, you don't need a second unsafe keyword inside another unsafe. And you don't need a semicolon after a struct or class declaration.
public unsafe struct V
{
public V* backpointer;
}
Eslam Afifi
|
|
|
|
|
In .NET a struct is always a value type, it's not like in C++ where a struct is either a reference type or a value type depending on how it's used.
You should use a class, not a struct.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks for your replies
|
|
|
|
|
Does anyone know how to use Rijndael managed with the varying blocksizes?
I have some code to encrypt passwords for storage in a table, however, the blocksize is 128. From what I understand, 128, 160, 192, 224, and 256 bit block sizes can be used. But, when I try, I get an error.
I have been unable to find an article to be able to do it this way. Anyone know of any articles that you can point me to or provide a simple example if you already have one?
Revolutionary: Disk drives go round and round.
|
|
|
|
|
Can I know what you've actually tried that hasn't worked? I would imagine, you'd be able to just set the key size, and then set the key accordingly.
|
|
|
|
|
Take a look here[^], it might help.
While (true) { Human.isLearnable = true; }
|
|
|
|