Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
TheReverend
Jun 21, 2005

Compact Framework Question: Case of the mystery pseudo-memory leak!

I know that this is a stab in the dark here, as I have never really seen anyone comment on mobile .net apps in here but I have a pseudo memory leak issue.

If I leave my application running and go to see how much memory is available(~68MB), I see that the amount of free space decreases by about .01MB every 1-3 seconds. Eventually the decrease will stop and it will hover at a level about 3.0MB less than when I first opened the memory checker (~65MB). When I go back to the program, everything is fine.

When I go back to the memory checker the available free RAM goes back to it's original level(~68MB). It is like the leak is only present when I am looking for it and even then it doesn't really affect anything.

Performance wise this isn't an issue. It runs for hours. Buy I can't figure out why this would happen? Any ideas?

Adbot
ADBOT LOVES YOU

SLOSifl
Aug 10, 2002


I have a rather extensive desktop application that I "ported" to the .NET CF a while back. All I really did was create a new Mobile project and added all the same source files as links (select Add as Link in the Add Existing File dialog). Some full framework features don't exist in the CF, but you should have no problems going the other way.

I'd suggest that you do the same thing in reverse - create a Desktop project, add the exact source files as links, and see if the issue still happens. If so, then you will probably have a much easier time debugging it as a normal Windows application. I've used ".NET Memory Profiler" before with reasonable success.

chutwig
May 28, 2001

BURLAP SATCHEL OF CRACKERJACKS

I've started working on some stuff with BackgroundWorkers and I have a bit of a conundrum that involves accessing the UI controls from the non-GUI classes that are doing the work. Right now, the program is broken down into the MainWindow class that just contains the event handlers for clicking buttons, a Connection class that handles connecting to a certain WMI node, and a Query class that handles making WMI queries asychronously through a BackgroundWorker and then (supposedly) updating a DataGridView with the results as the ObjectReady event handler fires. This is where I'm running into my problem; how do I get the DataTable from the Query class to a point where I can bind it to the DataGridView, since I can't directly access the DataGridView from any of the other classes? Passing the DataGridView control in the method called from the original click event handler just seems ugly and I'm not even sure it would work. I know my actual WMI query code is fine, because it's spitting out each result in MessageBoxes, and I've done this while just having everything in one class, but now that I want to organize my code a bit more I'm kind of stumped. Being that this is about my first time actually doing anything meaningful with event-driven GUI programming, I shouldn't be surprised that I'm running into these kinds of problems, but it's still a little frustrating.

chutwig
May 28, 2001

BURLAP SATCHEL OF CRACKERJACKS

I think I figured it out. In the GUI thread, create a delegate that takes a DataTable as its argument and a method to rebind the DataGridView to the DataTable and do the GUI updates as necessary, then instantiate that delegate in my ObjectReady event handler to be called each time a row is added. Guess I'll try it on Monday and find out.

LoonyLeif
Jul 17, 2001

You know, if Dave Thomas is really dead, then how does he keep coming out with all these new sandwiches?
Does anyone know how I would go about starting a VNC file in hidden or minimized mode, waiting for it to load, and then maximizing the window? I would want to do this to "page" through a list of VNC files for monitoring purposes. I know how to use threading and the Timer function, I'm just missing a few more pieces of the puzzle here.

SLOSifl
Aug 10, 2002


LoonyLeif posted:

Does anyone know how I would go about starting a VNC file in hidden or minimized mode, waiting for it to load, and then maximizing the window? I would want to do this to "page" through a list of VNC files for monitoring purposes. I know how to use threading and the Timer function, I'm just missing a few more pieces of the puzzle here.
Assuming you're using the ProcessStartInfo class to launch VNC (either directly or through "start.exe"), you can set the WindowStyle property to ProcessWindowStyle.Minimized before running the Process.

Use whatever logic you need to determine that it's done loading, then you can use ShowWindow to restore or maximize the window using the MainWindowHandle property of the Process object. There might be an easier way, I don't know.

ndb
Aug 25, 2005

Using C#, I am coming across an XML Exception, root element is missing. But my root element is clearly there.

Here is the suspect XML file (hit.xml):
code:
<?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
		<player>
			<name>Weakling</name>
			<score>500</score>
		</player>
		<player>
			<name>Jeff</name>
			<score>1500</score>
		</player>
		<player>
			<name>Poo</name>
			<score>5000</score>
		</player>

		<player>
			<name>Paula</name>
			<score>15000</score>
		</player>
	<player>
		<name>Ness</name>
		<score>50000</score>
	</player>
</XnaContent>
Here's a fragment of the code in which the code is read using XMLDocument.

code:
  XmlDocument hit = new XmlDocument();
            hit.Load("hit.xml");
            
            int i = 0;
            XmlNodeList playerlist = hit.GetElementsByTagName("player");

            foreach(XmlNode d in playerlist)
            {
                XmlElement pElem = (XmlElement)d;

                names[i] = pElem.GetElementsByTagName("name")[0].InnerText;
                scores[i] = Int32.Parse(pElem.GetElementsByTagName("score")[0].InnerText);
                i++;
                
            }
This is really frustrating me, and nothing that came up during a Google Search helped. The only thing that came up is that any general XML error may come up as "Root Element Missing".

The most interesting thing was that it worked earlier today. Now it's not working. The only thing that changed was that I deleted a <Asset Type = "System.String"> </Asset> tag which doesn't even matter since it's not being used an XNA asset. However, I did add that back in, and it still didn't work.

It stopped working after I wrote a method to write to the file, but it crashes at hit.Load("hit.xml").

EDIT: The error is run-time, if that helps any.

ndb fucked around with this message at 14:00 on Apr 28, 2008

SLOSifl
Aug 10, 2002


This is a shot in the dark, but I recently dealt with a similar issue. Try setting the XML file's encoding to ASCII and see if that works. If so (and you need or want UTF-8 support), then you may have to manually strip the header from the file.

edit: Or change try to match the 'encoding' attribute's value to the file's actual encoding.

uXs
May 3, 2005

Mark it zero!

Z-Bo posted:

Has anyone here leveraged XAML this way?

This post is pretty hilarious if you've just read the "corporate buzzwords" rant thread in GBS.

ndb
Aug 25, 2005

SLOSifl posted:

This is a shot in the dark, but I recently dealt with a similar issue. Try setting the XML file's encoding to ASCII and see if that works. If so (and you need or want UTF-8 support), then you may have to manually strip the header from the file.

edit: Or change try to match the 'encoding' attribute's value to the file's actual encoding.

Sadly, that doesn't work. Also if you change the XML file's encoding, it seems to automatically change it in Visual Studio, which I guess is handy.

EDIT: I fixed it, and I have no idea what I did. I created a new XML file, and then copy paste the old content into the new file. Works like a charm.

ndb fucked around with this message at 21:31 on Apr 28, 2008

Vinlaen
Feb 19, 2008

I'm still learning about C#, .NET, and Attributes and I have a simple question...

Lets say I'm designing a game and certain objects are "networkable" (eg. ghosted across a network)...

I know there are different approaches to this, but would it be possible to use a custom attribute applied to a GameObject class that would cause any instantiation of GameObject to be automatically added to a NetworkManager object?

...or is this not really what attributes are intended for?

csammis
Aug 26, 2003

Mental Institution

Vinlaen posted:

I'm still learning about C#, .NET, and Attributes and I have a simple question...

Lets say I'm designing a game and certain objects are "networkable" (eg. ghosted across a network)...

I know there are different approaches to this, but would it be possible to use a custom attribute applied to a GameObject class that would cause any instantiation of GameObject to be automatically added to a NetworkManager object?

...or is this not really what attributes are intended for?

For the most part, attributes don't really do anything, they just indicate what an object can do. You can't, for instance, add an attribute to an object's constructor that would cause the runtime to automatically add the new reference to a manager - but you could add an attribute that says "this networkable object should be added to a manager."

I would say it'd be a better approach to use a factory for your GameObjects that does the adding to the NetworkManager as a function of object creation.

SLOSifl
Aug 10, 2002


^ What he said. Attributes aren't attached to object instances themselves, just the class definition. In other words, they don't even have a chance to interact with a specific instance.

If you have access to the code such that you can add an attribute, you might as well add a line to the constructor, create a base class, write a factory, etc.

Attributes are great, but they are metadata for your code, to be acted on elsewhere.

Vinlaen
Feb 19, 2008

Ahh, OK. Thanks!

What about if I had a [Replicate] attribute that I attached to fields inside of a class that I could then use when replcating the object across a network? (eg. only the fields with the attribute would actually be sent, etc)

csammis
Aug 26, 2003

Mental Institution

Vinlaen posted:

Ahh, OK. Thanks!

What about if I had a [Replicate] attribute that I attached to fields inside of a class that I could then use when replcating the object across a network? (eg. only the fields with the attribute would actually be sent, etc)

Look into using WCF (Windows Communication Foundation) instead of a homegrown solution, it does exactly what you're proposing.

fankey
Aug 31, 2001

I have a Generic class for which each data type used I need to register an ISerializationSurrogate. I can do this manually but it's pretty much guaranteed that I'll miss 20% of any manual steps required. What I'd like to do is something like
code:
 
    public static IFormatter GetFormatter()
    {
      BinaryFormatter bf = new BinaryFormatter();
      SurrogateSelector ss = new SurrogateSelector();
      // somehow find every type that the Generic class has been instantiated on
      Type[] types;
      foreach(Type type in types)
      {
        ss.AddSurrogate( 
          typeof( GenericCollection<type>),
          new StreamingContext(StreamingContextStates.All ),
          new GenericCollectionSerializationSurrogate<type>());
      }
      bf.SurrogateSelector = ss;
      return bf;
    }
By adding a custom Attribute to the declaration of each instance of my GenericCollection I could probably find all of them but that's still a manual step to remember to tag each one.

2 solutions ( which I have no idea whether they are possible ) that I've thought of are (a) somehow requiring a custom attribute be set on all instances of a given or type and raise a compile error if they aren't set, or (b) finding all declarations of a giving generic type. One issue is that at the time I need the Surrogates there is no guarantee that any of these classes have been instantiated - otherwise I could just register the Surrogates in the constructor of the class.

POKEMAN SAM
Jul 8, 2004

fankey posted:

2 solutions ( which I have no idea whether they are possible ) that I've thought of are (a) somehow requiring a custom attribute be set on all instances of a given or type and raise a compile error if they aren't set, or (b) finding all declarations of a giving generic type. One issue is that at the time I need the Surrogates there is no guarantee that any of these classes have been instantiated - otherwise I could just register the Surrogates in the constructor of the class.

Have you looked into the Reflection namespace in .NET? If an elegant solution to your problem exists, it'll live there. You should be able to go through a namespace/class and list out every type in that namespace/class, but I'm not sure exactly how it works with generics.

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:

fankey posted:

I have a Generic class for which each data type used I need to register an ISerializationSurrogate. I can do this manually but it's pretty much guaranteed that I'll miss 20% of any manual steps required...
Are all the types you need to register contained within a single assembly, or do you know all the assemblies on beforehand?

If so, you can search the assemblies for the relevant types using reflection. If this isn't the case, then I'm not sure whether it's possible to do what you want, as it's not guaranteed that all assemblies will be loaded when you create the formatter.

Either way, you'll have to use reflection, because this won't work:
code:
 
    foreach(Type type in types)
      {
        ss.AddSurrogate( 
          typeof( GenericCollection<type>),
          new StreamingContext(StreamingContextStates.All ),
          new GenericCollectionSerializationSurrogate<type>());
      }
Off the top of my head, it shold be something like:
code:
foreach(Type type in types)
{
  Type issType = typeof(GenericCollectionSerializationSurrogate<>).MakeGeneric(type);
  ISerializationSurrogate iss = issType.Assembly.CreateInstance(issType.FullName) as ISerializationSurrogate;

  ss.AddSurrogate(
    typeof(GenericCollection<>).MakeGeneric(type),
    new StreamingContext(StreamingContextStates.All),
    iss);
}

dwazegek fucked around with this message at 21:40 on Apr 29, 2008

fankey
Aug 31, 2001

^^^^ yes, they are all in the same assembly.

Ugg boots posted:

Have you looked into the Reflection namespace in .NET? If an elegant solution to your problem exists, it'll live there. You should be able to go through a namespace/class and list out every type in that namespace/class, but I'm not sure exactly how it works with generics.
In theory that would work - I'm able to get all the types I care about and iterate their fields -
code:
  class MyObject
  {
    public List<int> IntList = new List<int>();
    public List<int> AnotherIntList = new List<int>();
    public List<string> StringList = new List<string>();
  }

  class Program
  {
    static void Main(string[] args)
    {
      try
      {
        Type[] types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
        foreach (Type x in types)
        {
          if (x == typeof(MyObject))
          {
            FieldInfo[] fis = x.GetFields();
            foreach (FieldInfo fi in fis)
            {
              Type fieldType = fi.FieldType;
              Console.WriteLine("field {0}, Typename {1}, IsGeneric : {2}", fi.Name, fi.FieldType.Name, fi.FieldType.IsGenericType); 
            }
          }
        }
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.Message);
      }
    }
  }
gets me
code:
field IntList, Typename List`1, IsGeneric : True
field AnotherIntList, Typename List`1, IsGeneric : True
field StringList, Typename List`1, IsGeneric : True
I just don't see a way to determine that a field is a List<> of some type, and then determine what type it was constructed with. I can check against specific types but I was hoping for something completely generic.

fankey fucked around with this message at 21:43 on Apr 29, 2008

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:

fankey posted:

I just don't see a way to determine that a field is a List<> of some type, and then determine what type it was constructed with. I can check against specific types but I was hoping for something completely generic.
Type.GetGenericTypeDefinition for the first problem, GetGenericArguments for the second.

edit:
So something like:
typeof(List<int>).GetGenericTypeDefinition() == typeof(List<>)

fankey
Aug 31, 2001

dwazegek posted:

Type.GetGenericTypeDefinition for the first problem, GetGenericArguments for the second.

edit:
So something like:
typeof(List<int>).GetGenericTypeDefinition() == typeof(List<>)
Thanks, that worked. I wasn't aware that typeof(List<>) was valid. I figured you always needed to specify a type inside the <>. It's interesting that the syntax hilighting in VS only shows List<> as a class if it's inside typeof() and not if it's sitting out there alone.

Nurbs
Aug 31, 2001

Three fries short of a happy meal...Whacko!
I'm working with creating a page that will automatically log someone into a system and then redirect them to an internal page based on a url in the querystring.

To do the automatic login I use a httpwebrequest to the system's API, which returns cookies for the session id and whatnot, but aren't actually written to the cookies folder. I need to get these cookies to the client browser, so that when it redirects to the internal page, the client looks like it has logged in.

Basically I have to hijack a session, but I don't know how. I tried adding the cookies to the Page.Session object, and to the Response.Cookies object with no success. It might also be relevant that the API uses ASP classic whereas I've been working on my solution in ASP.NET

TheReverend
Jun 21, 2005

Im making a WinWorm application that uses a third party library. I want to serialize one of the third party objects but it does not implement the serialization interface :(

What are my options?

Note: I don't have access to the third party source code.

fankey
Aug 31, 2001

TheReverend posted:

Im making a WinWorm application that uses a third party library. I want to serialize one of the third party objects but it does not implement the serialization interface :(

What are my options?

Note: I don't have access to the third party source code.
My question above indirectly dealt with this. You might try implementing an ISerializationSurrogate - see this article as an example.

boo_radley
Dec 30, 2005

Politeness costs nothing
When creating a snippet, there's an option to provide a HelpUrl. I've added a test url (file:///c:/ in one snippet and http://cnn.com in another), but I don't see a place in the manager that lists the url, and it doesn't seem to come up in intellisense anywhere. How do people get to the url?


VVV thanks, that's sort of what I expected.

boo_radley fucked around with this message at 21:17 on Apr 30, 2008

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

boo_radley posted:

When creating a snippet, there's an option to provide a HelpUrl. I've added a test url (file:///c:/ in one snippet and http://cnn.com in another), but I don't see a place in the manager that lists the url, and it doesn't seem to come up in intellisense anywhere. How do people get to the url?

From MSDN

quote:

Remarks

Visual Studio 2005 does not use the HelpUrl element. The element is part of the IntelliSense Code Snippet XML schema and any code snippet containing the element will validate, but the value of the element is never used.

SixPabst
Oct 24, 2006

Kind of on topic: can anyone recommend me a good ASP.NET host that is not discountasp.net? I have hosting with HostGator right now for some other sites and it looks like they are coming out with Windows plans sometime, but I haven't got an answer from them as to when.

If you know of any that offer decent reseller packages or even have personal experience with anyone other than discountasp.net, I'd appreciate it.

And yes, I've Googled. I generally trust opinions of goons more than the rest of the internet.

wwb
Aug 17, 2004

I haven't hosted with them personally, but MaximumASP is reasonably good. Or at least good enough to host SubSonic and some other stuff. CrystalTech is another name, but I don't have as much 2nd party experience with them.

Z-Bo
Jul 2, 2005
more like z-butt
Any XAML experts here?

In her blog post, [url=]Why should you use ObjectDataProvider?[/url], Beatriz Costa says that:

code:
When adding the source object directly to the [Window.Resources],
the [WPF] data binding engine calls the default constructor for that type.
For me, this is strange. Why would the data binding engine be responsible for initiating a source object defined in Window.Resources? I understand why the default constructor has to be called, but why is it called inside the data binding engine?

I tried figuring this out through the Reflector, but wasn't sure where to look to understand this and OH GOD is the parser for XAML in the PresentationFramework assembly messed up. I can't imagine why they have so many wrapper functions just to do the actual parsing.

csammis
Aug 26, 2003

Mental Institution
Your link's bad, but here is the article in question: http://www.beacosta.com/blog/?m=200603

As far as I'm aware, resource objects are lazy-initialized by the first thing that utilizes them, which in this case is the data binding engine. If the resource was a Brush, the rendering engine would be the component that initializes it when an object in the visual tree tries to access it.

SLOSifl
Aug 10, 2002


wwb posted:

I haven't hosted with them personally, but MaximumASP is reasonably good. Or at least good enough to host SubSonic and some other stuff. CrystalTech is another name, but I don't have as much 2nd party experience with them.
I use 1 and 1, but with a linux based plan. It would be worth checking them out - they have Windows packages as well and I have been *very* happy with their hosting for the last few years.

They have a deal to get the first 3 months of their "Home" plan for free:
Here

SixPabst
Oct 24, 2006

SLOSifl posted:

I use 1 and 1, but with a linux based plan. It would be worth checking them out - they have Windows packages as well and I have been *very* happy with their hosting for the last few years.

They have a deal to get the first 3 months of their "Home" plan for free:
Here

Exactly what I was looking for. Many thanks!

Z-Bo
Jul 2, 2005
more like z-butt
My problem is conceptual.

In XAML, resource references are grouped into StaticResource and DynamicResource markup extensions. StaticResource markup extension replaces a given value by substituting it with an already defined resource reference. Therefore, if I have:

code:
<Window.Resources>
<!-- Photos is the CLR type of my data model -->
<local:Photos x:Key="photos"/>
<!-- Mock object for testing one Photo -->
<local:Photo x:Key="mockPhoto" Name="butt" PhotoUri="http://example.com/butt.png"/>
</Window.Resources>
The way I interpret those two resources is that they are both being instantiated using their respective default constructors, and then added to the resources dictionary.

What's cooking my brain is the generic phrase "define a resource [...and...] reference it in attributes of child elements". This is strange for me, because when I think define a resource, I think class definition. When I think reference, I think object reference (and therefore assume it's instantiated when it is defined). But then, what is the StaticResource and DynamicResource dichotomy for?

This is all really just to troubleshoot my CustomViewSource problem I described earlier.

Z-Bo fucked around with this message at 18:16 on May 1, 2008

csammis
Aug 26, 2003

Mental Institution

Z-Bo posted:

What's cooking my brain is the generic phrase "define a resource [...and...] reference it in attributes of child elements". This is strange for me, because when I think define a resource, I think class definition. When I think reference, I think object reference (and therefore assume it's instantiated when it is defined).

No. Say it with me: XAML elements are not CLR objects. There is absolutely a correspondence, but they're conceptually different entities and you have to start thinking of them like that. Defining a XAML resource is declaring it by putting the element in a XAML file. Referencing the resource is utilizing it. Instantiation as a CLR object is a separate concern, as I mentioned before (did that actually help you? You didn't respond). There's nothing to do except get over what you're hung up on :)

quote:

But then, what is the StaticResource and DynamicResource dichotomy for?

A binding that utilizes a DynamicResource adds specialized listeners to react to changes in the resource, a StaticResource doesn't. As an example, imagine I have a Brush declared in my resources somewhere with the key "MyBrush," then reference like so:
code:
<Button Foreground={StaticResource MyBrush} />
Now, if I reach into the ResourceDictionary and replace the MyBrush object with a new Brush with a different color, the button won't change. If I had referenced using a DynamicResource, however, the visual tree would update to reflect the new resource and the button's foreground would change. This makes DynamicResources slightly more expensive, but crucial for matters such as skinning.

uh zip zoom
May 28, 2003

Sensitive Thugs Need Hugs

hey, I'm trying to send an e-mail with c#. The content for the e-mail comes from a text file using StreamReader. Could someone maybe learn me how to send this e-mail off with its carriage feeds intact? I've tried using ReadToEnd(), and the following loop:
code:
string emailBody = ""
while ((emailBody = emailFile.ReadLine()) != null)
{
  emailbody += emailFile.ReadLine() + vbCrLf;
}
unfortunately, these e-mails with their headers and salutations get sent off as a single line.

poopiehead
Oct 6, 2004

Maybe the content type is text/html? Easiest way to check(other than finding a way to look at the email headers) would be to change vbcrlf to "<br />". If that works, then it's html. If it is, then see if you can sent the content type with whatever library you're using to "text/plain", in which case you could just do read to end and not worry about newlines.

poopiehead fucked around with this message at 23:19 on May 3, 2008

uh zip zoom
May 28, 2003

Sensitive Thugs Need Hugs

poopiehead posted:

Maybe the content type is text/html? Easiest way to check(other than finding a way to look at the email headers) would be to change vbcrlf to "<br />". If that works, then it's html. If it is, then see if you can sent the content type with whatever library you're using to "text/plain", in which case you could just do read to end and not worry about newlines.

I tried that, too, and it had no effect. Perhaps the SMTP client/mail message might have something to do with it?
code:
SmtpClient mail = new SmtpClient();
MailMessage msg = new MailMessage(Settings.Current.AppEmailFromAddress, Settings.Current.AppEmailToAddress);
//msg.IsBodyHtml = true;
msg.Subject = Settings.Current.AppEmailSubject;
msg.Body = emailBody;
mail.Send(msg);

Dromio
Oct 16, 2002
Sleeper

uh zip zoom posted:

code:
string emailBody = ""
while ((emailBody = emailFile.ReadLine()) != null)
{
  emailbody += emailFile.ReadLine() + vbCrLf;
}

This doesn't seem quite right to me. It looks like you're reading lines twice, and re-assigning the entirity of emailBody on the read statement. I'd use a StringBuilder like this:

code:
StringBuilder emailBody = new StringBuilder();
while(emailFile.Peek()>=0)
{
  emailbody.appendLine(emailFile.ReadLine());
}

uh zip zoom
May 28, 2003

Sensitive Thugs Need Hugs

poopiehead posted:

Maybe the content type is text/html? Easiest way to check(other than finding a way to look at the email headers) would be to change vbcrlf to "<br />". If that works, then it's html. If it is, then see if you can sent the content type with whatever library you're using to "text/plain", in which case you could just do read to end and not worry about newlines.

well, it turns out that according to the e-mail headers the content type is text/html, but adding those break tags had no effect on the e-mail being sent out.

Adbot
ADBOT LOVES YOU

poopiehead
Oct 6, 2004

uh zip zoom posted:

well, it turns out that according to the e-mail headers the content type is text/html, but adding those break tags had no effect on the e-mail being sent out.

Maybe try setting the header directly. probably something like
code:
msg.Headers["Content-Type"] = "text/plain";
Also, dromio's right. If that code was pasted, then it's only going to have the last one or two lines and with no line breaks.

  • Locked thread