|
Can't you use IndexOfAny()???
e.g.
<br />
string myString = "Hello Dave, how are you today?";<br />
string searchString = "Dave";<br />
<br />
bool isSubstring = (myString.IndexOfAny(searchString)!= -1);<br />
<br />
if(isSubstring)...<br />
HTH
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
;P O ... ya.. thx! But, I always feel the String is too small , thank you very much !!
|
|
|
|
|
Anytime.
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Had a look at StringBuilder?
System.Text.StringBuilder
In C++, CString does the job of both System.String and System.Text.StringBuilder.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
What size should I use to get an equivalent C struct for the type bool?
i.e.
struct
{
DWORD a;
bool b;
} s;
would be
struct s
{
int a;
// bool a; or char a; or byte a; ?
}
...what's the best way to marshal C bools?
|
|
|
|
|
grv575 wrote:
...what's the best way to marshal C bools?
bool is not a C data type. Look at the typedef of it.
<a TITLE="See my user info" href=http:
|
|
|
|
|
unsigned char or int?
What's more common (VC 6 i guess, if anyone can check)
|
|
|
|
|
What does it say in the header file? It all depends how that implementation is defining it.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Wish I knew. I deleted VS6 and am not keen on reinstalling it. In any case I'm almost certain it's typedef int bool or typedef enum { false, true } bool.
Either way, it looks like I need a dword size field.
|
|
|
|
|
I am writing a utility to help deploy some applications.
This utility is used to check the pre-requisites on a PC before an install will be attempted.
One of these aplications uses MAPI.Session and CDO.Message to recieve emails and send emails via SMTP.
How can I detect if MAPI and CDO are installed on the PC using C#
Thanks for your help
Andy
|
|
|
|
|
Thanks WiB,
I know what MAPI and CDO are but I am trying to find a way of checking they are installed on a PC.
My current testing since posting the question is this - which seems to be working.
protected void CheckMAPI()
{
try
{
Type objMAPIType = Type.GetTypeFromProgID("MAPI.Session",true);
object objMAPI = Activator.CreateInstance(objMAPIType);
if (objMAPI == null)
{
txtMAPIStatus.Text = "MAPI not installed";
}
else
{
txtMAPIStatus.Text = "MAPI Installed";
}
}
catch (Exception e)
{
txtMAPIStatus.Text = "MAPI not installed";
//MessageBox.Show ("Exception - " + e.Message);
}
}
|
|
|
|
|
I am creating a ocx that is a treeview.
I am trying to capture the OnNotify with
NMHDR *phdr = (NMHDR *)lParam;
// Coming from listview?
if( phdr->code == NM_RCLICK )
MessageBox(NULL, "Right click found", "Click", MB_OK);
but i am only getting the calls when the mouse is clicked on the header, same goes for Double click, what am I doing wrong,
any help is really appreciated
shotgun
|
|
|
|
|
I don't understand... looking at your code...
What is "->"????
Why do you have so much multiplication in the code too "*"????
And surely it should be MessageBox.Show("Right Click Found", "Click");
Sorry, Only joking ShotGun, but this is the C# forum...
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Hi All,
How to read file into a structure? The file is created by VC++ 6.0.
For example:
VC++ Code:
struct MyStruct
{
short a;
int b;
char c[20];
short d;
};
CFile aFile;
...
MyStruct aStrcut;
aStruct.a = 1;
...
aFile.Write(&aStruct, sizeof(MyStruct));
I'd like to read the file into the following struct in C#, how? please advice.
[StructLayout(LayoutKind.Sequential, Pack=1)]
struct MyStruct
{
public short a;
public int b;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)]
public string c;
public short d;
};
|
|
|
|
|
I'm kind of new to C#, but would like to make at simple monitoring tool for my internet connection - upload/download.
Is it possible to get acces to the Sent/Received on the "Locale Area Conection Status" - dialog?
It would also be nice if I could get a value for the Sending/Receiving speed.
|
|
|
|
|
|
Yes, thank you very much
|
|
|
|
|
Anyone know how to make a control transparent. The TransparentKey property is not available in the control as it is on a form ?
|
|
|
|
|
|
Hi, I'm starting to use Active Directory and I have found many C# examples about the topic but I still cannot find something that helps me setup a development environment for Active Directory
At this point I have a vmware virtual machine running windows 2000 but the Active Directory configuration is causing me some troubles
Anyone knows about a whitepaper or any kind of material that helps me setup a development environment with Active Directory in my laptop?
Thanks
Isaac
|
|
|
|
|
|
Have a look at the latest Dwamish Sample on MSDN. They user AD and have some quite good guidelines and procedures for setting up common development/test/production environments.
HTH
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
It's stupid question (no relevance to C#, only relevance is that I want to use icons from MS Word toolbar).
Do you know which DLL in MS Office contains all the icons/bitmaps used by Word or Excel?
I googled for this Dll, but I didn't get it.
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
|
Kannan Kalyanaraman wrote:
I suggest you try Resource Explorer [1]
Thx KK. I already have different tools like that. My question was specific to MS Office toolbar resources (icons/bitmaps) in the DLL.
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|