|
made in 44 wrote: set a font a font that I have downloaded
Go to the location where you saved the font to and copy it into the Windows Fonts directory after scanning it for viruses etc.
Now that that's done. Inside the properties pane for the TextBox control, you should be able to open the list and see your new font.
Regards,
Jason Pezzimenti.
If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.
|
|
|
|
|
You can access the Exists method of System.IO.File class directly like so:
bool fooExists = System.IO.File.Exists("C:\foo.txt");
I have created a class that has a method in it that logs an exception to an XML file, such as:
namespace Matt.Clarkson
{
using System;
using System.IO;
using System.Xml;
using System.Security;
using System.Windows;
public class ExceptionLogging
{
public bool LogException(Exception ex)
{
[code for logging file]
}
{
}
I can access this fine with the following code:
Matt.Clarkson.ExceptionLogging foo = new Matt.Clarkson.ExceptionLogging();
try
{
System.IO.Path.GetDirectoryName(">?|>FDA{}{}!@'#~¬");
}
catch (Exception ex)
{
foo.LogException("Epic Fail", ex);
}
But I cannot do:
Matt.Clarkson.ExceptionLogging.LogException("Epic Fail", ex);
I understand why I cannot do the above line of code but how can i structure my classes/namespace so that i can use methods like in the .NET framework File.Exists example above. I have no need to create a new ExceptionLogging class as I just want the method inside.
I know that the above method could just be the constructor of the class but I am looking to understand the way to do this structure.
I would love to read a tutorial on this subject but I'm not even sure what this falls under?
Thanks for any help,
Regards,
Matt Clarkson
|
|
|
|
|
public static class ExceptionLogging
{
public static bool LogException(Exception ex)
{
[code for logging file]
}
}
|
|
|
|
|
|
To extend the previous answer, you do not need to decvlare the class as static, only the method.
The usage rules are very simple, an object can call any static, or class, methods but class methods can only call instance methods of passed references.
An object can reference class variables; there is a single instance of a class variable shared by all of the instances.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Dear Experts,
I want to develop an instant messaging software for LAN, like YPressChat, I'm new to socket programing in c#. Is there any example or any help or any idea about??
thanks in advance
|
|
|
|
|
|
thanks for your kind reply!!
I read that article, thats good. But in the sample application there are two separate applications ( server and client ), I want the the server and client both implemented in a single application like YPress chat application.
is there any idea about???
thanks again!
|
|
|
|
|
I am trying to Read a selected value from a dropdownlist nested inside the Datagridview. This is a winform Application. How do I do this?
|
|
|
|
|
I am very pleased for you. I assume this is all going well as you haven't actually asked a question.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi, anyone who know how to convert .pst files to .xml files using C# programming language? Need help!Thanks.
|
|
|
|
|
What
Have
You
Tried?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
i tried to create a small application about converting my MS Outlook .pst files to .xml files. After that just open a folder to store it inside.
|
|
|
|
|
I presume you mean the outlook .pst file. If so what leads you to think it can be converted to an XML file. From the little I have worked with Outlook this is a monster, I believe it is a database of mail items.
Or does 2007 store the .pst as XML?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yup.What i mean of .pst files is MS Outlook files. I got an idea to create a small application to convert my MS Outlook .pst files to the .xml files so that i can store it for future use.Is it difficult to do this?
|
|
|
|
|
tchshiping wrote: it difficult to do this?
From this question I assume you have not worked with Outlook much. The data structure inside a PST has got to be horrendous, think about the types of data that is stored Notes, email, contacts, etc etc etc.
Try referencing Outlook and wandering through the properties of the objects in there, this will give you an idea of the complexity. And what if MS changes the internal format/structure on you. This is the overriding reason no one has touched this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hello, I'm trying to read .pst file in txt form, what i do please help
thanks in advance
|
|
|
|
|
hello
I'm trying to export a function which returns an array of double:
<br />
#ifndef _MATLAB_GENERIC_DLL_H_<br />
#define _MATLAB_GENERIC_DLL_H_<br />
<br />
<br />
#ifdef MATLABGENERICDLL_EXPORTS<br />
#define MATLABGENERICDLL_API __declspec(dllexport)<br />
#else<br />
#define MATLABGENERICDLL_API __declspec(dllimport)<br />
#endif<br />
<br />
<br />
extern "C"<br />
{<br />
<br />
MATLABGENERICDLL_API void FormatDrive();<br />
MATLABGENERICDLL_API void CopyFiles(char* Src, char* Tgt);<br />
MATLABGENERICDLL_API void ToUpper(char* Src);<br />
MATLABGENERICDLL_API char* ToUpper2(char* Src);<br />
MATLABGENERICDLL_API double* GetSomeDoubleArray(char* Src);<br />
}<br />
#endif //_MATLAB_GENERIC_DLL_H_<br />
The actual implementation looks like this:
<br />
MATLABGENERICDLL_API double* GetSomeDoubleArray(char* Src)<br />
{<br />
double SomeArray[10];<br />
<br />
for(int i=0; i<10; i++)<br />
{<br />
if(i>0) {<br />
SomeArray[i] = 1.1 * SomeArray[i-1];<br />
} else {<br />
SomeArray[i] = 0.5;<br />
}<br />
}<br />
return SomeArray;<br />
}<br />
From dotnet/C# code:
<br />
class Program<br />
{<br />
[DllImport(@"C:\MatlabGenericDll.dll")]<br />
private static extern string ToUpper2(string Src);<br />
<br />
[DllImport(@"C:\MatlabGenericDll.dll")]<br />
private static extern double[] GetSomeDoubleArray(string Src);<br />
<br />
static void Main(string[] args)<br />
{<br />
string strTest = "abc";<br />
string strResult = null;<br />
<br />
double[] SomeArray= null;<br />
<br />
try<br />
{<br />
strResult = ToUpper2(strTest);
SomeArray= SomeArray("abcde");
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine(ex.ToString());<br />
}<br />
<br />
return;<br />
}<br />
}<br />
Suggestion?!
Thanks
dev
|
|
|
|
|
GetSomeDoubleArray returns a pointer, so you must go unmanaged and get your data starting from that pointer, and put in into an array. I know there's a System.IntPtr type which can help with Int32 data, but I don't know if there's anything for Double s.
But there's a problem with your implementation: you return a pointer to an array declared in the function's scope, which is allocated on the stack and destroyed when the function exits!
So if you absolutely need to return the array you should make it static. You can allocate and deallocate it upon loading and unloading the DLL, either automatically (by a declaration in the main scope) or manually. Watch out for thread safety if you need it, and it's done.
But the best way to solve your problem would be to declare a double[] array on the C# side and pass it by reference to GetSomeDoubleArray - it will save you all the headaches.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Hello
I've got once again a problem with an application of mine..
Im building and application which checks a defined list of links. This windows form application should be able to run from any computer within our company. We have different security zones and we use a proxy configurated by with a automatic configuration script.
Now for internet website I haven't any problems. I just use the default proxy and fill the credentials with my user informations. But for the websites into the intranet it doesn't work like that. I just always get a 401 (unauthorized) error message.
I know that it's possible to solve that problem without knowing our network security exactly but hopefully anybody has an idea anyway.
Thanks a lot and best reagrds
|
|
|
|
|
how does your application access the link ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Over the System.Net.WebRequest class
WebRequest request = WebRequest.Create(Path);
request.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
(HttpWebResponse)request.GetResponse();
|
|
|
|
|
Remember the way you access your intranet is not the same way you access the internet. so i think you have to create a one function and detect if its internet or Intranet and extract the correct url for each
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hmm.. This I've already done. I was clear that I have to different between internet and intranet otherwise it had worked. But I dont know how can I access to the intranet.. Any idea?
Thanks for your help!
|
|
|
|
|
Now I just trey by chance the way to read the site over the System.Net.WebClient class and it worked pretty well.
Actually I have no idea where's the difference but for the moment it's enough, when it works. I'll try to find out why later..
|
|
|
|