|
I know how to use the System.Web.Mail class to send mail through smtp but I want to use this for error reporting for one of my programs and I don't have a public smtp server. Are there free smtp servers that I can relay this through or is there a better way to report errors to me?
Thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
what about your ISP's, you would probably need SMTP auth though if the ppl running your app are not on your ISP's domain. this would be a maintenance nightmare if you hade more than a few apps distributed and you changed ISP's
Im sure there *are not* public SMTP's as the internet has more than enough spam already.
what about just ftp'ing it to you from the remote site, or http tunnelling ?
hth
g00fy
|
|
|
|
|
thanks for the reply. what http commands would I use to send the mail? I tried quickly searching google but it was talking about ssh tunneling, is this what you're talking about?
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
I've created a program to track my tasks I have to do at work. I use a listview to display the tasks. Some of my tasks require certain steps be followed before I can complete them.
I plan on adding the ability to add requirements to a task. But, here's my idea! I would like to somehow be able to have a ProgressBar that is somewhat transparent across the entire row of each task that shows the progress of that task. I'm trying to figure out if it's possible to have a 1/2 transparent progressbar display on top of each of my tasks. Is it possible? How can I do this?
|
|
|
|
|
Howdy,
Sorry for the basic question...moving over to C# and having trouble finding an alternate to the following...
//constructor
public foo(int, string[])
{
//blah
}
...
foo bar = new foo(1,{"1","2","3","4"});
Any help &/or suggestion would be greatly appreciated. Thanks!
~rcurrie
|
|
|
|
|
Sorry, jumped the gun there a little bit...
The issue I am having is that C# doesn't seem to like this syntax. I could easily get around it by defining my own string[] w/ values prior to creating a new foo object. But I'm hoping to just be able to define the string[] on the fly as indicated in the bold, italicized text above...thanks!
~rcurrie
|
|
|
|
|
Try this:
foo bar = new foo(1, new string[] {"1", "2", "3", "4"});
|
|
|
|
|
Much appreciated Robert, thanks so much!
|
|
|
|
|
hi all.
I just need to ask one question !
how can split the incoming string into string array by finite small string i know that split method for normal string can split the string into string array but with specific character not exceed one character like the following
--------------------------------------
<br />
using System;<br />
namespace snouto<br />
{<br />
class stringargs<br />
{<br />
static void Main(string[] args)<br />
{<br />
string string1 = "hi#thatisme#yeah";<br />
char[] splitters = {'#'};<br />
string[] separated = string1.split(splitters);<br />
}<br />
In the above code i split my string into string array using # character format but if i want to split my string by using another string like "snouto" in tha above string
<br />
string string1 = "hisnoutoThatismesnoutoYeah";<br />
how can i split the above string using snouto which repeated inside the string
Please help
Miss With The Best And Die Like The Rest
|
|
|
|
|
AFAIK, there is no predefined method for what you want to do. You have to explicitly loop through the characters in the string and split them. Off the top of my head,
string[] Split(string text, string separator)
{
ArrayList splitStrings = new ArrayList();
int index = -1;
int prevIndex = index;
while ((index = text.IndexOf(separator, prevIndex)) != -1)
{
splitStrings.Add(text.Substring(prevIndex, index-prevIndex));
prevIndex = index + separator.Length;
}
return (string[]) splitStrings.ToArray(typeof(string));
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Instead you can rely on more popular regular expressions.
try this...
<br />
using System.Text.RegularExpressions;<br />
<br />
string original = "hisnoutoThatismesnoutoYeah";<br />
Regex reg = new Regex("snouto");
string[] splitStrings = reg.Split(original);<br />
Using Regular Expressions is comparatively faster that any other operations directly on strings
Hope this helps!!!
Regards,
Sidhu
IF YOU DON'T HAVE ANYTHING TO SAY, WELCOME TO THE CLUB
Dotnet @ Work Where Dotnet works...
My Blog
|
|
|
|
|
Hello:
I am trying to develop a flowchart generator.
It seems to me that i have to develop first a parser for the language being diagrammed.
Do you know of any starting point to do this? since on these days it seems that we are alway reinventing the wheel.
Best Regards
Roberto.
|
|
|
|
|
Hi am writing a chat server and I was stress testing my server and found some errors.
Say I have an arraylist.
ArrayList sockets = new ArrayList(listOfSockets);
Now I call Socket.Select to take out the sockets that don't have data on them.
Socket.Select(sockets, null, null, 100000000);
This is where the error happens, if I pass in a ArrayList that has 65 sockets in it.
It causes a IndexOutOfRangeException to happen. I have tried using other ways of doing it and it causes different errors but it always happens when it reaches 65 sockets.
I am dumbfounded please help.
------------------
I'm naked under my clothes...
|
|
|
|
|
|
Hi ...
I have created a ListBox on a Form. I would like to write to the ListBox from other classes using a wrapper method in the Form Class.
I have a public method in the Form1 Class called WriteStatusMessage(). This method will format the string and add the date and time and in the future could write to a file.
I would like to be able to call this method from other classes. In the sample code below I an able to create an instance of the Form1 Class and then call the WriteStatusMessage() method. Stepping through the code I actaully get into the method and to the point where I do the Add() on the ListBox.Item Object.
Any idea why the message will not display on the ListBox? As you can see I have tryed the Update() and Invalidate() method, both to repaint the ListBox?
Thanks,
Chris
<br />
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace TestBlueRayon<br />
{<br />
<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
<br />
<br />
private void menuItemVideo_Click(object sender, System.EventArgs e)<br />
{<br />
string strMessage;<br />
<br />
strMessage = "Create Video Object";<br />
WriteStatusMessage(strMessage);<br />
<br />
Video GreenVideo = new Video();<br />
<br />
GreenVideo.SetVideoContrast();<br />
}<br />
<br />
<br />
<br />
<br />
public void WriteStatusMessage(string strMessage)<br />
{<br />
string strDisplayMessage;<br />
<br />
DateTime dtCurrent = DateTime.Now;<br />
<br />
int nYear = dtCurrent.Year;<br />
int nMonth = dtCurrent.Month;<br />
int nDay = dtCurrent.Day;<br />
int nHour = dtCurrent.Hour;<br />
int nMinute = dtCurrent.Minute;<br />
int nSecond = dtCurrent.Second;<br />
int nMillisecond = dtCurrent.Millisecond;<br />
<br />
<br />
string strTemp;<br />
<br />
strDisplayMessage = String.Format("{0,0:D4}.{1,0:D2}.{2,0:D2} {3,0:D2}:{4,0:D2}:{5,0:D2}.{6,0:D3} {7}",<br />
nYear,<br />
nMonth,<br />
nDay,<br />
nHour,<br />
nMinute,<br />
nSecond,<br />
nMillisecond,<br />
strMessage);<br />
<br />
this.ListBoxStatus.BeginUpdate();<br />
this.ListBoxStatus.Items.Add(strDisplayMessage);<br />
this.ListBoxStatus.EndUpdate();<br />
<br />
this.ListBoxStatus.Update();<br />
<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
namespace TestBlueRayon<br />
{<br />
public class Video<br />
{<br />
public Video()<br />
{<br />
Form1 NewForm = new Form1();<br />
NewForm.WriteStatusMessage("Hello");<br />
}<br />
<br />
public int nColor;<br />
public int nHue;<br />
public string strComment;<br />
<br />
<br />
<br />
public void SetVideoContrast(int nIndex)<br />
{<br />
<br />
Form1 NewForm = new Form1();<br />
NewForm.WriteStatusMessage("Hello");<br />
<br />
nColor = 12;<br />
nHue = 34;<br />
strComment = "Contrast has been set";<br />
<br />
<br />
}<br />
<br />
}<br />
}<br />
<br />
Thanks,
Chris Macgowan
macgowan@pobox.com
|
|
|
|
|
Try taking off the BeginUpdate and EndUpdate calls sandwiching the Add method. I had the same problem once and taking off BeginUpdate and EndUpdate solved it, although I still don't know know why/how. Maybe it's a bug in the .NET framework.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
The problem I can see with your code is...
When you are trying to add elements to the listbox, you are creating a new instance of your form object. this will never point to the current form being displayed. So even if you call add(), it will add to the listbox on the form which is never displayed.
Instead, you have to get the reference to the existing form and then call add method.
Hope this helps!!!
Regards,
Sidhu
IF YOU DON'T HAVE ANYTHING TO SAY, WELCOME TO THE CLUB
Dotnet @ Work Where Dotnet works...
My Blog
|
|
|
|
|
Thanks IAMJUNK ...
The following is the solution to the ListBox Issue
Thanks also to Andy Tacker (CodeGuru)
Note that we added a reference to the form in the Video Class (m_ParentForm1). Then when we create the Video Object in the Form1 Object we will set the Video.m_ParentForm1 attribute to be <this> to set the reference back to the Form1 Object. Then when we want to use the Form1::WriteStatusMessage() method we can used the reference to Form1 from m_ParentForm1.
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace TestBlueRayon<br />
{<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.MenuItem menuItemVideo;<br />
private System.Windows.Forms.ListBox ListBoxStatus;<br />
<br />
private System.ComponentModel.Container components = null;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
WriteStatusMessage("TestBlueRayon Application Started.");<br />
WriteStatusMessage("Good to have you with us. ");<br />
<br />
}<br />
<br />
<br />
#region Windows Form Designer generated code<br />
private void InitializeComponent()<br />
{<br />
this.mainMenu1 = new System.Windows.Forms.MainMenu();<br />
this.ResumeLayout(false);<br />
}<br />
#endregion<br />
<br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.Run(new Form1());<br />
}<br />
<br />
<br />
<br />
private void menuItemVideo_Click(object sender, System.EventArgs e)<br />
{<br />
string strMessage;<br />
<br />
strMessage = "Create Video Object";<br />
WriteStatusMessage(strMessage);<br />
<br />
Video GreenVideo = new Video();<br />
<br />
GreenVideo.m_ParentForm1 = this;<br />
<br />
GreenVideo.SetVideoContrast(0);<br />
}<br />
<br />
<br />
<br />
<br />
public void WriteStatusMessage(string strMessage)<br />
{<br />
string strDisplayMessage;<br />
<br />
DateTime dtCurrent = DateTime.Now;<br />
<br />
int nYear = dtCurrent.Year;<br />
int nMonth = dtCurrent.Month;<br />
int nDay = dtCurrent.Day;<br />
int nHour = dtCurrent.Hour;<br />
int nMinute = dtCurrent.Minute;<br />
int nSecond = dtCurrent.Second;<br />
int nMillisecond = dtCurrent.Millisecond;<br />
<br />
string strTemp;<br />
<br />
strDisplayMessage = String.Format("{0,0:D4}.{1,0:D2}.{2,0:D2} {3,0:D2}:{4,0:D2}:{5,0:D2}.{6,0:D3} {7}",<br />
nYear,<br />
nMonth,<br />
nDay,<br />
nHour,<br />
nMinute,<br />
nSecond,<br />
nMillisecond,<br />
strMessage);<br />
<br />
this.ListBoxStatus.Items.Add(strDisplayMessage);<br />
<br />
this.ListBoxStatus.Update();<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
<br />
using System;<br />
<br />
namespace TestBlueRayon<br />
{<br />
public class Video<br />
{<br />
<br />
public int nColor;<br />
public int nHue;<br />
public string strComment;<br />
public Form1 m_ParentForm1;<br />
<br />
public Video()<br />
{<br />
nColor = 0;<br />
nHue = 0;<br />
m_ParentForm1 = null;<br />
}<br />
<br />
public void SetVideoContrast(int nIndex)<br />
{<br />
nColor = 12;<br />
nHue = 34;<br />
strComment = "Contrast has been set";<br />
<br />
if (m_ParentForm1 != null)<br />
{<br />
m_ParentForm1.WriteStatusMessage("SetVideoContrast() called");<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
|
|
|
|
|
I want to write a program that will connect to my router and enter my username and pw and then send the command "enable" and input the pw to my router. Is there something out there that will someone what show me the light on how to do this? This will be done in C also.
thanks
I shall steal all the kittens.
|
|
|
|
|
sorry I should also say this will be done on a freebsd based platform also
I shall steal all the kittens.
|
|
|
|
|
I have a .NET server application on a machine with a static IP address who publishes a singleton object:
MyServerObject obj = new MyServerObject();
RemotingServices.Marshal(obj, "TheServerObjectIsHere.remote");
The client publishes his listener object to the server, and connects to the server:
MyClientObject obj = new MyClientObject();
RemotingServices.Marshal(obj, "TheClientObjectIsHere.remote");
MyServerObject serverObj = RemotingServices.Connect("tcp://someStaticIpAddress/TheServerObjectIsHere.remote");
serverObj.Hello();
However, the server needs to connect to the client object, who's published object is on some network outside the LAN. Since the client object is not on the server's LAN,
RemotingServices.Connect("tcp://someLanAddress/TheClientObjectIsHere.remote")
will not work, because the server isn't on the same LAN, therefore a client address like "tcp://10.10.10.1/Client.remote" means nothing to the server.
So my question is, how does .NET remoting work over a WAN or the internet? Or, if you specifically have knowledge in this area, how can I connect to a MarshalByRefObject when it is on a different network?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
the only way to do this is to grab the ip from the client on the outside.
also, I havent used the uri the same way you do. I see you have TheClientObjectIsHere.remote. Shouldnt that be TheClientObjectIsHere.rem?
Maybe it doesnt matter, just looking over my code and comparing it.
but to answer your question you would need to put the ip where someLanAddress is. Also, make sure you have access to their machine and there is no firewall to hamper it. You might need to provide credentials when you connect. At least I did on mine.
Hope this helps alittle.
Steve Welborn
Software Architect
|
|
|
|
|
I am having trouble passing a string that has special characters in it as an argument in a program. To be specific
Method Signature: methodName(string)
I need to pass the following string: QTextPrint("TestMessage")
methodName("QTextPrint("TestMessage")"); Doesn't work
methodName(""QTextPrint("TestMessage")""); Doesn't work
methodName("QTextPrint\(\"TestMessage\"\)); Doesn't work
methodName(@"QTextPrint\(\"TestMessage\"\)); Doesn't work
Even attempting the same type of action in a stringbuilder doesnt work.
Any ideas would be appreciated.
Regards
Bob Robey
|
|
|
|
|
try this...
methodName("QTextPrint(\"TestMessage\")");
I Hope this should work.
If not give this a shot
string param = "QTextPrint({0}TextMessage{1})";
param = string.Format(param, "\"", "\"");
Hope this helps
Regards,
Sidhu
IF YOU DON'T HAVE ANYTHING TO SAY, WELCOME TO THE CLUB
Dotnet @ Work Where Dotnet works...
My Blog
|
|
|
|
|