|
Hi,
Can I use web services ( as a client), with old versions of visual basic and Visual C++ ( 6.0), with the .net framerwork installed ?
Thanks in advance
Braulio
|
|
|
|
|
You can use WebServices from legacy apps...you just need to look on MSDN for the SOAP toolkit.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
Hi,
Just download the Microsoft SOAP Tookit 3.0 .. Its on the Microsoft website. There are also Code Samples you can download.
If you have trouble I can post some code for you ..
|
|
|
|
|
Hi,
Can I use web services ( as a client), with old versions of visual basic and Visual C++ ( 6.0), with the .net framerwork installed ?
Thanks in advance
|
|
|
|
|
Two questions
1. I'm trying to use SMTP mail to send email from an application. Code works fine but the messages are left in the C:\Inetpub\mailroot\Queue folder. I have added localhost to the SMTP server settings (connection and relay).
MailMessage msg = new MailMessage();
msg.To = "my email";
msg.From = "my email";
msg.Subject = "test";
try
{
SmtpMail.Send(msg);
}
...
2. Previously I have used Mapi (in C++) to send mail using the local email settings. Does anyone know of a way to do this in C#. It seems better to use the local email program (outlook/outlook express) than having to configure an SMTP server for each user.
I’m probably missing something obvious, so any ideas on this would be great.
|
|
|
|
|
Well, MAPI is an API for the local client e-mail whereas the System.Web.Mail namespace deals only with SMTP servers. There's a reason it's in the System.Web namespace: they assume you're going to have an SMTP server of your own that you can point to. Are you trying to send mail from a Windows Forms app? (It looks as if you are) In that case, why not just use MAPI from C# and write up a CP article about it? Sure, it would involve P/Invoke, but it would get you the desired result.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
I found a mapi example. Code Project/C# Programming - Simple MAPI.NET by NETMaster.
I will try to get the SMTP working, but i assume that is a bit of topic here.
thanx
|
|
|
|
|
just thinking out loud, what's equivalent of dll and COM in .net?
remoting replaces DCOM... what about COM? or just dll?
i'm just starting off in C#.
norm
|
|
|
|
|
the equivalent is class library , windows control library
|
|
|
|
|
I have what is a very annoying and subtle little glitch that I cannot get rid of. I'll try to be brief and to the point.
I have a form, on it are a handful of Label controls that I have subclassed, but I haven't changed the way they draw or render at all, just added some private properties to them specific my app.
When you click on the label, a ContextMenu is shown, and the label's image property recieves a different image to show it in a downstate.
If you chose not to select a menu item and click somewhere within the form, the context menu dissapears, naturally, and the label's image state returns to normal.
However, if you click *outside* the form while the context menu is displayed, say on another application behind the form, which has the effect of the form losing its focus and falling behind, and then if you bring the form back to focus, the label's image can be seen for a half second to still be in its down state before changing back to the normal state.
I have tried to put the code that returns the labels image state to normal *everywhere* in the lifecycle of the form's visibility that I can possibly think of. But no matter what, for a half of a second you can still see it in its down state when the form returns.
I am pulling my hair out. It sounds trivial, but it looks very bad, and I cannot allow it to behave this way when released. Is there something I'm missing? Maybe something to do with validation of controls?
Anything?
Thanks for any ideas people might have and hearing my little tale of woe.
Matttingly
|
|
|
|
|
So adding a Form.Deactivate handler doesn't do the trick? Don't bother with validating stuff, it's just another thing in the focus event sequence. Did you try calling Update() to force an immediate repaint? Otherwise, invalidation just puts a WM_PAINT message in the message queue, which could already be loaded with other pending messages.
|
|
|
|
|
Yeah I tried it in Form.Deactivate and that didn't do anything. It does work, but the point is that it seems to actually get redrawn *after* the form is made visible again.
I should point out when the form is losing focus I make it Visble = False, or I think I might use .Hide().. But when it comes back I tried putting that in the Deactivate() handler and it redraw roughly a half second after the form is made visible again.
I will try Update(), that is one I hadn't thought of. Also I should point out I am using the Opacity property as well as transparency on some parts of the form. I don't see why this would matter, but with that stuff you never know..
Thanks, I'll post back my luck with Update(). I appreciate the response.
Mattingly
|
|
|
|
|
Thanks so much! Update did the trick.. Perfectly
|
|
|
|
|
Can a web service write to the registry on the server hosting it?
I have the following code, it works in a windows forms application, but not in this web service. My try/catch is catching that there is an error, but I am not sure how to display what that error detail is. Second part, and I know this is simple, how do I read in a URL var into my web service? Once I get this working, it's pretty simple, it just needs to read a 4 digit number, then write a string var into the registry on the server hosting the webservice. I am trying to automate some stuff on a windows media server. Here is my code so far:
<code>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using Microsoft.Win32;
namespace wmRegEdit
{
[WebService(Namespace="http://events.activegroup.net/ws/")]
public class wmRegRead : System.Web.Services.WebService
{
[WebMethod]
public string GetRegValues()
{
RegistryKey regKey;
regKey = Registry.LocalMachine.OpenSubKey(@"Software\MyTestRegKey");
string[] valnames = regKey.GetValueNames();
string val0 = (string)regKey.GetValue(valnames[0]);
string val1 = (string)regKey.GetValue(valnames[1]);
return val0 + val1;
}
[WebMethod]
public string WriteRegValues()
{
try
{
RegistryKey regKey;
regKey = Registry.LocalMachine.CreateSubKey(@"Software\MyTestRegKey");
//regKey = Registry.LocalMachine.OpenSubKey(@"Software\MyTestRegKey");
string[] valnames = regKey.GetValueNames();
string val0 = (string)regKey.GetValue(valnames[0]);
string val1 = (string)regKey.GetValue(valnames[1]);
regKey.SetValue("Domain", (string)"WorkGroup");
Registry.LocalMachine.Flush();
return val0 + val1;
}
catch
{
return "reg write error";
}
}
}
}
</code>
Thanks,
Bill K.
|
|
|
|
|
codeweenie wrote:
Can a web service write to the registry on the server hosting it?
Only if it runs under an account with permissions to do so. The default ASP.NET user isn't going to do it. Try the local admin account (if you know the password).
codeweenie wrote:
My try/catch is catching that there is an error, but I am not sure how to display what that error detail is.
Well, you need to rework the catch statement to catch the type of exception you want and then assign it to a variable...like this:
catch(Exception ex)
{
Debug.Writeline(ex.Message);
}
codeweenie wrote:
how do I read in a URL var into my web service? Once I get this working, it's pretty simple, it just needs to read a 4 digit number, then write a string var into the registry on the server hosting the webservice. I am trying to automate some stuff on a windows media server. Here is my code so far:
Why not change your method signature to:
WriteRegValues(int myInput){}
That's the accepted way to do Web Services and is really the whole point. Besides, the ASMX file will show you how to call it via an HTTP request.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
David Stone wrote:
Why not change your method signature to:
WriteRegValues(int myInput){}
That's the accepted way to do Web Services and is really the whole point. Besides, the ASMX file will show you how to call it via an HTTP request.
David,
I really don't understand what you mean with the above text?? Thanks for the heads up on the user account stuff. I was able to get that and the catch stuff working. The catch message told me what I thought it would. And your first point helped me fix that. That just leaves me with needing to get my simple little service to read a value from the url and write it into the reg for me. I think that I am close. I got google fired up and my .Net book too. However if you want to point me along a little farther, I don't mind...
Thanks again,
Bill K.
|
|
|
|
|
Well basically, what I meant was that you should change your method to have an parameter of the type you want to read in. You shouldn't rely on the querystring because what happens when the user calls the WebService from a Windows Forms application? There isn't any querystring. So what I suggest is changing your method from this:
WriteRegValues() {}
to
WriteRegValues(string myInput) {}
Forget the part about the HTTP Request...I was drifting off into another arena all together.
Do you understand how to call a WebService from another application? Are you using VS.NET? Because if you are then you could have an ASP.NET (or Windows Forms) app reference the webservice and then call WriteRegValues("Hey! This'll get written to the registry!");
Hope that clears things up.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
http://localhost/YourFile.asmx/WriteRegValues?myInput=theValueEntered
Would be used to call the WriteRegValues method and to assign a value to it's paramter myInput. I believe this is what you want to know, right? I hope it helps.
"We will thrive in the new environment, leaping across space and time, everywhere and nowhere, like air or radiation, redundant, self-replicating, and always evolving." -unspecified individual
|
|
|
|
|
Hi All
I am using the followinf statment in my app at work
DataRow[] adr = dlg.PMIClient.DataSet.Tables[0].Select("ServerID=" + nServerID.ToString());
the ServerID has long datatype.
this statement works well for the int id values, but if nServerID has a long value and if the value in the dataset the result of select will be nothing even there is a record that has the same id in the dataset
in other words the Select works well if ServerID is int not long.
|
|
|
|
|
In the DataSet definition itself, have you set the ServerID field to int or integer?
If I remember correctly, it must be integer to account for a long value, but whatever it is, try the other one.
Paul
And you run and you run to catch up with the sun, but it's sinking Racing around to come up behind you again The sun is the same in a relative way, but you're older Shorter of breath, one day closer to death - Pink Floyd, Time
|
|
|
|
|
I have a form with a background image. In the form is a user control. I have set the style of the user control to support transparent background. I have also set the color to be transparent. When the user control is drawn in the form, it sometimes show the image in the background fine,but other times, the image in the background is not lined up with the edges of the panel. It looks like the user control is holding on to a different rendition of the form background image that is slightly off centered.
Is there a way to make the image that is showing through the user control be exactly what is in the form background image? I am guessing I have to override the paint method, but the form should not be painting anything in the background, right?
Doesn't the child user control get invalidated when the parent form gets invalidated?
thanks
Bryan
|
|
|
|
|
Hello every one!
I found this article on how to creat a custom IE toolbar (like the one Google has):
http://www.codeproject.com/useritems/toolband.asp
Problem is, that this article is in C++.
Does anyone out there know of an example using C#??
I'd like to write a custom IE toolbar, where the user can download it and install, etc.
Also... the option of uninstalling.
Any help on this will be greatly appreciated!
Thanks in advance!
|
|
|
|
|
C#iruzo wrote:
Does anyone out there know of an example using C#??
There is one called BandObjects(here on CP) that is written in C#
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
|
C#iruzo wrote:
there might be one out there for Internet Explorer...
Its the same thing It works for both. I must warn you that its not very stable. EG, firing a thread do some work and closing the toolbar will cause windows shutdown dialog to be shown...
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|