|
Thanks for your reply...
I'm not particularly looking for 'one way' of doing it... Any way will be fine
I'm just looking more for direction as to how to go about doing it. The example I sited does achieve this somewhat by allowing 2 of the plugins to send feedback to the host which in turn launches a dialog box with the information sent to it.
What I am needing assistance with is how to get it to post that information to the host's main form (say a text box) rather than an independent dialog box. Further on down in the message section someone had asked something similar. They wanted to put some data sent from the plugin to the status bar. Someone had posted a reply saying they were able to do it and how, but the answer seemed incomplete so I was unable to duplicate it.
I guess my question really is this. I have 3 .cs files (pluginservices.cs which handles communication w/ host & plugin, my mainform.cs & mainform.designer.cs files) All of them belong to the same namespace (we'll call it 'host'). How can I access a button, textbox etc from my pluginservices.cs file. I thought that if I used a fully qualified name I would at least be able to access the object I want. Apparently this is not the case.
Please keep in mind that I am still rather new to C# so if there are any concepts that I may not be aware about that would make this seem trivial please point it out.
Thanks!
|
|
|
|
|
Paul Groetzner wrote: The example I sited does achieve this somewhat
Perhaps the plug-in design in the article is not suited to your requirements.
Paul Groetzner wrote: What I am needing assistance with is how to get it to post that information to the host's main form
Well if my first post didn't help you understand things more clearly I don't think I will be able to help. In my experience text messaging is not a great format for learning about design concepts, in contrast with a live session using white boards etc.
As a closing comment I would say you might be having a forest/tree problem. If you focus on trying to see "how to get object X to access object Y" rather than focusing on learning and understanding design principles and concepts you may always have this problem.
led mike
|
|
|
|
|
dasfasdfas
I love C# very much
|
|
|
|
|
|
Hi
I need to read a file in my PC in chunks,I should be able to read any chunk of file randomly.Is it possible?
Please advise me
Thanks
|
|
|
|
|
|
Hi,
I think you cannot write to XML using XMLReader or xmltextreader.
You, have to use DOM model for that.
use the XMLDocument class.
For Ex.
XMLDocument xdoc = new XMLDocument();
xdoc.Load(fileName);
now using xdoc with xpath you can navigate to the require node or you can create a new node.
I hope you got what u need.
ok bye.....
|
|
|
|
|
Hey guys, I'm sure this question will seem elementary to most of you.
There is a log file constantly being written to by an application I have no control over. It is a third party application. I do have access to a log file it writes to though. I want to open the file it's using and grab the data from it without having to do a lot of file.open .close stuff like I'm used to in c++. I'm fairly confident there is a way to do this, but I don't really know what it is. I'm still kind of a beginner in c# and am not familiar with all the tools available. I was also wondering if I could simply use that file as a stream and just update the stuff on my end whenever that file gets updated by the application.
If someone could point me in the right direction on this or give me a few tips as to which tools I might consider using, I'd appreciate it a lot.
|
|
|
|
|
Hi Kataric,
of course this is possible. I would use the FileSystemWatcher - element from the toolbox to watch the if the specific log file gets changed. Then just use the System.IO.Streamreader to read the content of the file.
Hope I could help you
|
|
|
|
|
I see, I was unaware of the FileSystemWatcher.
Anyone know how resource intensive that tool is?
|
|
|
|
|
Hello,
I have added a StatusStrip to my application. I am trying to change the Width of the status but for some reason I cannot change it from the defult value which is set to "22" in the properties windows!
Can someone tell me if it is possible to change the width of the StatusStrip and if it is, how I can do this?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Hi Khoramdin,
You can change the width of the StatusStrip to set the AutoSize property to false.
statusStrip1.AutoSize = false;
Thanks,
Gopal.S
|
|
|
|
|
hi to all
how can i order tables (data base) by defined feild , in CRYSTALL REPROT
for example , i want to use this query : select * from person order by age
where i must use from (order by age) clause?
thanks
|
|
|
|
|
So I have this app that has been creating some odd errors. Sadly, it has been throwing some odd and inexplicable error messages. No one I've sought help from has been able to help me with it. Mostly due to the fact that no one knows what's been causing the errors.
So after recoding many a thing and adding in some error handling, the errors are no longer occuring, but at the cost of reduced functionality. And then it donned on me...
What if I were to add some kind of error reporting that send me an error report through the email system we have in place...??? That way, I would know of the error as well as have an error dump of sorts. That way, I'll be able to find out what is causing the various errors that have been occuring.
Only 1 problem.
I don't know how to send mail through an Exchange server. I know you can make an email using SMTP, but that doesn't work here. I tried.
So where can I find some GOOD info on creating an app that will send an email through an exchange server? Unless someone knows how already. If you know how, could you bestow upon me such knowledge? Any and all help is always appreciated...
Thanks.
|
|
|
|
|
Sending an email programmatically through exchange is no big deal.
well .NET 2.0 has the ability create and send email via a specified SMTP server address. Have you tried looking at the System.Net.Mail namespace ?
Also here is a code snippet.
MailMessage mail = new MailMessage();
MailAddress ToMailAddress = new MailAddress("hello@helloworld.com");
MailAddress FromMailAddress = new MailAddress("goodbye@helloworld.com");
mail.From = FromMailAddress;
mail.To.Add(ToMailAddress);
mail.Subject = "Test Email";
mail.Body = "This is a test email";
System.Net.Mail.SmtpClient smtpServer = new System.Net.Mail.SmtpClient("192.168.0.1");
smtpServer.Send(mail);
Also you can try Lumisoft.NET dll which allows you to receive and send emails. You will need to google to get the Lumisoft .NET dll. Its free to use as well.
Hope this helps.
cheers
V
|
|
|
|
|
I took a look at the namespace, but 3/4 of it is just gibbersih to me...lol...
But I didn't know I could use the SMTP class to send VIA an Exchange server... I have need to try that. Thanks.
BTW... I *THINK* the exchange server has need of a username/password... Do you know how to use add that at all?
|
|
|
|
|
Spyder_Snyper wrote:
BTW... I *THINK* the exchange server has need of a username/password... Do you know how to use add that at all?
can you please clarify as to why you think you need the username/password ? As far as sending email via SMTP via MS Exchange you dont need to supply any username or password. Only when it comes to retreiving email via a user's mailstore on exchange then you do need the username/password.
If you can be a bit more specific with your problem I can attempt to help you a bit more.
|
|
|
|
|
I think I need the username password because everytime I try to send an email, I get an authentication error.
But then again, if, as you say, I don't need a username and password, THAT might be the problem.
I shall make an attempt with both, and make note of any errors that occur. If they do, I'll post the error messages here.
Thanks for the help man!
|
|
|
|
|
as far as why I think that the server requires authentication...
when I try to send an email, I get an error. It reads:
"5.7.3 Client does not have permission to submit mail to this server."
I think the message is a pretty dead giveaway...
|
|
|
|
|
does the client have an exchange mailstore associated with it ?
try this:
go to START->RUN type in cmd
from the command shell type in TELNET severIPaddress 110
110 is the POP3 protocol port number.
Type in USER username press enter
Type in PASS password press enter
Telnet should response with user successfully logged in. If it doesnt then you know that the user doesnt have access to the exchange server.
I dont have Exchange server installed on my test box yet. But when I did build my automated email client which sent emails out to my exchange server, i never had to supply a username/password to my email client software.
|
|
|
|
|
g'day mate,
sorry my earlier post does not make any sense. Tomorrow when I get to work I will install Exchange server on my test server and run that snippet of code i posted earlier. Just one thing did you actually run that snippet of code I post couple days ago ?
Will update tomorrow with my progress regarding username/password sending email.
sorry for not being too useful.
|
|
|
|
|
It's cool... No worries here.
The code that you have is what I am using at the moment.
I'll check out telnet and see what happens with that.
**EDIT**
So i checked out the telnet trick there. It sorta kinda worked. I could get to the login section where I typed USER and PASS. No matter the combination that I used, I could not get logged in. It may (or may not) be because I don't know where to put in the domain info. I tried with the user, but to no avail.
I *DO* know that the user name and password have access to the exchange server because I have Outlook set up, and it is using the exact same credentials as the user that I was using. And Outlook works just fine.
-- modified at 11:17 Monday 28th May, 2007
|
|
|
|
|
hi again,
today I installed Exchange 2003 on my test server running windows server 2003. The same test server was my domain controller. I just did a default installation of Exchange and Active Directory. I didnt change any security settings etc because I have zero idea about active directory security maintenance.
I ran a test network with my test server being the exchange and domain controller. In this network I ran another Win XP client machine which was not part of my test domain. I wrote the SMTP code I gave you a few days ago as win app and ran it on this Win XP client machine and I was not prompted for any username or passwords.
This would leads me to believe that your configuration of active directory and exchange must be running some high security configuration which needs the user to be authenticated before any email can be sent out or received.
There are 3 solutions you can try:
1) The first solution is that the machine you are using to run the SMTP code I gave before needs to logon to the domain and authenticate the user. The user needs to be part of the active directory. Then run the email sending application you wrote. Maybe check with whoever setup the exchange server on its user authentication requirements.
2) You use an alternative .NET based SMTP class. I gave you the reference Lumisoft.dll. Go to this website and download this dll library:
http://www.lumisoft.ee/lsWWW/Download/Downloads/Net/LumiSoft.Net.zip
Create a new .NET windows application and use the Lumisoft dll to create an email sending application. You will need to use the LumiSoft.Net.SMTP.Client.SMTP_Client namespace. There is a chm helpfile which describes how to use the dll. I dont have the time right to write you a code snippet but read through the helpfile and there are code fragments to get you started.
If you get stuck go to the author's webpage he has a forums section and put a post there. The author is a very nice guy and he has an article on codeproject regarding the lumisoft.dll.
3) In the code I had provided earlier ensure that you used the defaultcredentials property take a look below:
System.Net.Mail.SmtpClient smtpServer = new System.Net.Mail.SmtpClient("192.168.0.1");
smtpServer.UseDefaultCredentials = true;
What this does is that whoever is logged on to the machine that is executing this code their credentials will be used to authenticate against the SMTP server. You have to makesure that the username and password are actually validated against active directory being used by your exchange server.
Let me know how you go and I will see if I can write some code using Lumisoft.
Good luck.
|
|
|
|
|
You give me much to work with...
Sadly, that first one isn't exactly an easy option to explore. What with the ungodly number of miles of red tape and all...
So that third one looks a little promissing. I was taking a look at a few other things that might help with that. I think it was called User Impersonation.
Do you know of this?
From what I've read, I *THINK* it may help me in this task.
But before I overcomplicate things, I first want to try your third option there, and if that doesn't work, I'll go for #2.
Once again, thanks for the help. I'll post the results when I get some...
|
|
|
|
|
well you are in a tough situation so looks like you get more and more work
I have heard of user impersonation. I believe that the DefaultCredentials aspect of the SMTP class would do the trick, which is the third option.
I'll see if I can work out how to sent restricted access on my Exchange server so that the user needs to be validated before they can send any emails out via SMTP. Then give option 3 a go myself. The key thing is that whichever user is logging onto the machine needs to be authenticated against AD successfully. Only then that particular user will be granted access to use Exchange and only then your little application will work. Provided you have enabled the DefaultCredentials feature in your code.
With impersonation you can do the samething. YOu need to define security attributes around the method which needs user impersonation.
Have you fun
|
|
|
|