I did mention it was the best way to do it. :)
espSquall commented: Very useful and quick response +1
I did mention it was the best way to do it. :)
In your first code, the first function never called your second.
Perhaps you need to put down more on paper how your brain thinks this will work.
Good god, no offense but that sounds as lazy as it gets
Outlook.Application app = new Outlook.Application();
Outlook.Selection oSel;
Outlook.Explorer oEx = app.ActiveExplorer;
oSel = oEx.Selection;
Object oItem;
oItem = oSel.Item;
if (oItem is Outlook.MailItem)
{
Outlook.MailItem oMail = (Outlook.MailItem)Oitem;
label1.Text = oMail.Subject;
}
all you had to do was paste in the info given..
But VB is lazy and allows you to do hiddeous things like adding characters and integers and setting strings to numbers if you let it. That doesnt make it right.
if you declare object as o you could test if o is Outlook.MailItem that seems to work.
Because (DUH) Object is not an outlook class that has that property.
In your code above, "Outlook.MeetingItem item" as long as you called item.MessageClass you would be ok.
Its a string, it will give you in words the type.
PS - just like in the vb example you posted
While having it in a separate function is best
Create a boolean variable, remove the returns and in their place, put the boolean variable = true or false accordingly.
Then move the whole block into the first and test the value of the boolean at the end as to wether it was true or false.
OK, but that will pick up only meeting items, as you cant assign mail items to a meetingitem, it will cause an exception. the messageclass property is text and will confirm then which subtype of the item you picked is, such as out of office etc.
PS now Im home, My indy has the property I listed. Please check again
Try your current code on a non password protected file and it should work.
Frirstly, Im not male. Please do not make such rash assumptions.
Secondly, Ive asked for some code as it would seem you've approached it very differently from me as all items correctly report their code for me, and perhaps you're going about it the wrong way.
You dont appear to have told it to use the basic authentification.
IdHTTP1.Request.BasicAuthentication := true;
Assuming its popping up with a standard html login dialog box, not some web based login.
Accessing mails from outlooks inbox is generally quite simple and mine seems to pick up the differences. What code do you have as while I didnt derrive mine from that vb, mine uses pretty much the same concept.
Out of interest if you dont set it to maximized, but change the size does it work then?
They come with indy..
Please mark as solved then
on form startup check the current cell location
regex is the easiest way to split it, theres many examples on how to split up html using regex out there.
debugging would show wether your mail settings are being picked up for your new smtpclient. If not, it maybe better to set them.
Normal coding practice would be make the form for when you want it, and then free it - as a result next time you make it, it will be as it was in the beginning.
Otherwise you need to make a reset function on the form that puts everything back.
If you want to download an MDB file you cant update it online, it would be read only as you would have to download a copy and then use it from a temp/semi perminant location.
Take a look at the indy components, they are the easiest to use.
Please mark the thread as solved
how would you split it then?/xorl
I already said how Id split it - I just wouldnt have made it so it was a physical string of \r\n, but the escape characters.
Hmmmm i did a split like this
string []titles = readpls.split(new string[]{@"\", @"\r\n"},
[snip]
Hmmmm i did a split like this
[0] "#extm3u\r\n#extinf:4779,addictive djs - crush on hardcore 3\r\n" //remove with indexof?
[1] "Streamripper"
[2] "addictive djs - crush on hardcore 3.mp3\r\n#extinf:312,al storm and the acolyte ft lisa abbott - falling through (alistair storm remix)\r\n"
Well I guess thats what happens when you tell it to take as litteral the escape characters you were trying to split at..
sigh
Well if you did an initial split on \\ and \r\n, you would have a bunch of stuff and then parts of which would be
#extinf:nnnnn,
so you could find the , and remove upto it, and its your title, or, if it ends in .mp3 its your filename..
I hadnt checked the if (a=b) thing, I did however assume that would work like c/c++ would, my bad. :P
I fell fowl of the ignored the return value of a function when I was using the string replace function, quickly hacking some code together for something and forgot to assign the changed string back to itself..
I am surprised on its pickiest warning level it doesnt mention that you didnt use the returned value, perhaps you should suggest it for VS2010 which is in beta..
At the same time, I cant help but wonder then how many times we all use some function and ignore its return code... and how many warnings it would generate if it did actually warn us..
google is your friend.
Check httpwebresponse and httpwebrequest
Your classes arent public - so you cant see them
I believe so, its not something I gave much consideration to, Although I do know for example youc ould argue that one of the things in C was that you could do things such as
if (a = b) { .. }
which worked if a got set to b and is still valid in c#, so you could argue a lot of return values arent used as the boolean in that case isnt used in a single line of
a= b;
Just because a function returns something it isnt always required you want it.. While I havent checked Im fairly sure you can do so with most functions.. in fact things like
String s = "this is a test";
s.Replace("s","5");
Doesnt produce the desired effect because it returns a string, but the code didnt make use of it - but it compiles and runs :)
Would be best to ask them that.
As I said change the selected item..
I wouldnt expect it to, as what is jim called with? you expecting it to call it with 0?
I know the Jim can be, but at the same time think in most modern coding standards its frowned on as it is more confusing to read
Well a short bit of debugging would show you part of the problem.
Try just changing the index of the selected item if its not the right one.
Sure there are no spaces? which was the point of the break point? Why not
the value in combox must be changing if the code youve said (eg the labels) is true. Hence Ive asked about the spaces
I guess it depends a little why you would have such a structure, however, if the forms have to remain forms, but work except the main form, you can of course disable it.. and have a counter so that when you close the other forms, they decrease the counter so that you can then use the main form when and only when all the blocking forms have closed.
The bad side of that is you would also need to be careful come the windows shutdown message
Id have thought it would have complained at
jim:=x
as jim the parameter cant be set a value, it returnsone, but I guess theres tha possibility you're making use of the using the name of the function aspect as the return variable.
I guess then the other choice is
bill(jim);
where jim has no values sent to it.
first thing to do is put a break point on the if combobox1.text <> 4 line and see what combobox1.text value really is and confirm its running the code
I dsiagree, I would expect what you gave it, because you've overriden it, and it still conforms to the interface, but the class itself is still there!
Google is your friend.
Search for free c# ebooks, tutorials, read the beginning of them, one will feel more right than the rest, go through that.
You havent said what you're trying to achieve other than c#..
There are a lot of places to read on c# including microsoft who include examples with most of the methods in c#..
What are you trying to make and what problem are you having?
Hurray! Dont forget to mark your thread as solved
Thats why we coders invented a progress called debugging.. watch what it does step by step you'll find it then.
Your min function still tests if the numbers are BIGGER than the ones you have.. You also probably would want to start at a high number and work down as 0 would always be the lowest number..
Id go with a bit of stupid but not a lot..
You still kept it as a string with ' marks, and the c:\ bit and so on..
if you want filename in the box, just use the edit2.text..
If you want to force other things.. that you need to think of, such as what if someone put
NUL in there
or
CON:
or just \
both of which are reserved
and the file wont be written the way you think.
Because you dont check Process32First, if there is none.. that will be fase and you could save yourself a lot of effort with changing the name of your variable to mean still looking.. so its
finding := Process32First..
while finding do
begin
if match
then ..
else
finding = process32Next...
end;