|
You should ask the article author. Odds seem good to me that you're not hooked up with a working service to send SMS messages.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok fine, check this code and tell me pls.
mTo = Convert.ToString(txtToNumber.Text.Trim()) + Convert.ToString(cboCarrier.SelectedItem.ToString().Trim());
mFrom = Convert.ToString(txtFrom.Text.Trim());
mSubject = Convert.ToString(txtSubject.Text.Trim());
mMsg = Convert.ToString(txtMessage.Text.Trim());
try
{
MailMessage message = new MailMessage(mFrom, mTo, mSubject, mMsg);
SmtpClient mySmtpClient = new SmtpClient("mail.econsultants.in");
mySmtpClient.UseDefaultCredentials = true;
mySmtpClient.Send(message);
MessageBox("The mail message has been sent to " + message.To.ToString());
}
In drop down i added these....
cboCarrier.Items.Add("@itelemigcelular.com.br")
cboCarrier.Items.Add("@message.alltel.com")
cboCarrier.Items.Add("@message.pioneerenidcellular.com")
cboCarrier.Items.Add("@messaging.cellone-sf.com")
cboCarrier.Items.Add("@messaging.centurytel.net")
cboCarrier.Items.Add("@messaging.sprintpcs.com")
cboCarrier.Items.Add("@mobile.att.net")
cboCarrier.Items.Add("@mobile.cell1se.com")
cboCarrier.Items.Add("@mobile.celloneusa.com")
cboCarrier.Items.Add("@mobile.dobson.net")
cboCarrier.Items.Add("@mobile.mycingular.com")
cboCarrier.Items.Add("@mobile.mycingular.net")
cboCarrier.Items.Add("@mobile.surewest.com")
cboCarrier.Items.Add("@msg.acsalaska.com")
cboCarrier.Items.Add("@msg.clearnet.com")
cboCarrier.Items.Add("@msg.mactel.com")
cboCarrier.Items.Add("@msg.myvzw.com")
cboCarrier.Items.Add("@msg.telus.com")
cboCarrier.Items.Add("@mycellular.com")
cboCarrier.Items.Add("@mycingular.com")
cboCarrier.Items.Add("@mycingular.net")
cboCarrier.Items.Add("@mycingular.textmsg.com")
cboCarrier.Items.Add("@o2.net.br")
cboCarrier.Items.Add("@ondefor.com")
cboCarrier.Items.Add("@pcs.rogers.com")
cboCarrier.Items.Add("@personal-net.com.ar")
cboCarrier.Items.Add("@personal.net.py")
cboCarrier.Items.Add("@portafree.com")
cboCarrier.Items.Add("@qwest.com")
cboCarrier.Items.Add("@qwestmp.com")
cboCarrier.Items.Add("@sbcemail.com")
cboCarrier.Items.Add("@sms.bluecell.com")
cboCarrier.Items.Add("@sms.cwjamaica.com")
cboCarrier.Items.Add("@sms.edgewireless.com")
cboCarrier.Items.Add("@sms.hickorytech.com")
cboCarrier.Items.Add("@sms.net.nz")
cboCarrier.Items.Add("@sms.pscel.com")
cboCarrier.Items.Add("@smsc.vzpacifica.net")
cboCarrier.Items.Add("@speedmemo.com")
cboCarrier.Items.Add("@suncom1.com")
cboCarrier.Items.Add("@sungram.com")
cboCarrier.Items.Add("@telesurf.com.py")
cboCarrier.Items.Add("@teletexto.rcp.net.pe")
cboCarrier.Items.Add("@text.houstoncellular.net")
cboCarrier.Items.Add("@text.telus.com")
cboCarrier.Items.Add("@timnet.com")
cboCarrier.Items.Add("@timnet.com.br")
cboCarrier.Items.Add("@tms.suncom.com")
cboCarrier.Items.Add("@tmomail.net")
cboCarrier.Items.Add("@tsttmobile.co.tt")
cboCarrier.Items.Add("@txt.bellmobility.ca")
cboCarrier.Items.Add("@typetalk.ruralcellular.com")
cboCarrier.Items.Add("@unistar.unifon.com.ar")
cboCarrier.Items.Add("@uscc.textmsg.com")
cboCarrier.Items.Add("@voicestream.net")
cboCarrier.Items.Add("@vtext.com")
cboCarrier.Items.Add("@wireless.bellsouth.com")
krishna
|
|
|
|
|
Is it possible to change the extension of the produced assembly dll to something else. Any solution other than PostBuildEvent ? Looking for solution like CustomAttribute setting or anything like that.
Imtiaz
modified on Tuesday, February 12, 2008 10:03 PM
|
|
|
|
|
Navigate to the assembly in File Explorer, right click the file and select rename.
only two letters away from being an asset
|
|
|
|
|
I am using DataGrid without any database bound. I have costum Columns. I wanted when i put in a numeric value, my cell to display in currency. Tried to put C2 in format and didnt work.
And is it possible using event handler for a cell?
|
|
|
|
|
In my program I am opening another program (a console application) with System.Diagnostics.Process.Start.
How do I hide the console window?
Or if I can't do that in that program (A c# console application) how do I hide the console window?
|
|
|
|
|
Someone asked that last week, try searching for it.
|
|
|
|
|
Hi Guy
very easy man
Process process = new Process();
ProcessStartInfo pStartInfo = new ProcessStartInfo("Your file Name");
pStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo = pStartInfo;
process.Start();
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Thanks so much. Works like a charm
-Brandy
|
|
|
|
|
You are welcome
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
On my form1.cs am displaying around 200 images inside a listbox. Each listbox item contains an image but when i am looking on task manager window in winxp my application is using the most memory. I am controlling the onDrawItem like this
protected override void OnDrawItem(DrawItemEventArgs e)
{
Graphics g = e.Graphics;
Bitmap b1 = new Bitmap(400, 300);
((myImageItems )Items[e.Index]).DrawToBitmap(b1, new Rectangle(0, 0, 400, 300));
Bitmap b = new Bitmap(b1,new Size(100,60));
e.Graphics.DrawImage(b1, e.Bounds.X , e.Bounds.Y , b.Width, b.Height);
g.dispose();
b1.dispose();
b.dispose();
}
I do'nt know where to look into this i tried debuggin but no help so far. Any help i appreciate it.
Thanks
|
|
|
|
|
netJP12L wrote: Graphics g = e.Graphics;
This is SO redundant.
netJP12L wrote: Bitmap b1 = new Bitmap(400, 300);
Why not use meaningful variable names ? And the using keyword ?
netJP12L wrote: g.dispose();
You don't dispose of an object that was passed to you on the event args. Creating a local reference to it makes it more likely you would forget that. Use 'using' blocks, instead of calling dispose.
How much memory is it using ? Remember, the memory usage you see represents more than the memory in use right now, perhaps creating these bitmaps and disposing of them over and over is the reason the number is so high ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for replying Graus, I have edited my codes as you mentioned but still when i start my app the memory is 278,000 and as i click on the downScrollbar its goes up around 350,000+. Can you please help me from your Magic coding. Apart from drawing my own do u think there could be else where problem because all those listbox item i am keeping them in a List of myImageItems
Bitmap imgItm = new Bitmap(400, 300);
Rectangle rect = new Rectangle(0, 0, 400, 300);
protected override void OnDrawItem(DrawItemEventArgs e)
{
using ( Font f = new Font(e.Font.FontFamily, e.Font.Size, FontStyle.Bold))
{
((myImageItems)Items[e.Index]).DrawToBitmap(imgItm , rect);
e.Graphics.DrawImage(imgItm , e.Bounds.X, e.Bounds.Y , 120, 80);
}
}
|
|
|
|
|
350k ? I doubt there's much you can do about it. If it keeps climbing, you've got issues. If what you're describing is the extent of it, then you're probably fine.
Where does the code you've posted use the font you're creating ? Am I missing something ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks once again actually the memory flucate it goes like, starts with 377,000k then when i click quickly couple of times on the downScrollbar it jumps to 415,000k then 500,000k and goes back like 314,000k. The maximum it goes up to 550,000k, haven't seen crossing that. Another thing i noticed that when i click on the downscrollbar button listbox flick and i can see that it's drawing. I put this in the constructor but no result
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
In your last post you were saying "perhaps creating these bitmaps and disposing of them over and over is the reason the number is so high ? " if i do'nt create them how else i can do what i am want to do. Can you please show me in ur examples.
I mistakenly deleted the Font code the are as follows.
e.Graphics.DrawString("Picture" + (e.Index + 1), f, Brushes.Black, e.Bounds, StringFormat.GenericDefault);
One of the most important thing i have seen is that i added 200 images in Ms power point too. but when i look at it its memory like 228,000k. and all those clips load way to faster than my application. What may i do to achieve the same result.
Thanks for readign this much.
|
|
|
|
|
netJP12L wrote: if i do'nt create them how else i can do what i am want to do.
By creating them once and keeping them in memory to draw as needed. This would also speed things up, which could help your flicker issues.
netJP12L wrote: One of the most important thing i have seen is that i added 200 images in Ms power point too. but when i look at it its memory like 228,000k. and all those clips load way to faster than my application. What may i do to achieve the same result.
First of all, you're wasting your time watching memory usage this closely ( it just isn't that accurate, and the fact that it goes back down shows there is no leak ). The best way to use less memory is to use C++, like powerpoint does. But, I am sure it would cache the images and not create them every time, as you are doing, that should be enough to solve the issue.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am trying to bold certain paragraphs in a rich text box and have the other text regular then print the document. Can anyone assist me?
Thanks
|
|
|
|
|
Use RichTextBox.SelectionFont, RichTextBox.SelectionStart, RichTextBox.SelectionLength and RichTextBox.SelectedText properties.
|
|
|
|
|
I want to add an object in my listview i can add string but not any controls
Object obj = new Object();
listviewItem itm = new listviewItem(obj);
listview1.Items.Add(itm);
Thanks
|
|
|
|
|
What are you trying to do?
only two letters away from being an asset
|
|
|
|
|
I have seen ListBox.Items.Add which takes an object i want to do the same thing with the listview but listview doesn't take anyother objects other than string. so i can control the drawing of each listviewitems.
|
|
|
|
|
MSDN[^]
It takes a string or a ListViewItem. Create your own class inheritting from ListViewItem and do the manipulation you require in there. When returning an Item(s) just cast it to your class type and any extra properties/methods etc will be available.
Dave
|
|
|
|
|
Hi Guy
I think Listview directlly not support add object.You one option to do this, create a own object with inherit in ListViewItem,add ur a collection or any other kind of list. after add to that listViewItem into ListView.
i hope this is help to u.
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Something like what DaveyM69 suggested. SIX hours ago.
only two letters away from being an asset
|
|
|
|
|
I have had to, on a number of occasions, do something like the following:
switch (a.GetType().FullName) {
case "System.Int32":
...
break;
case "MyNamespace.SubNamespace.MyClass":
...
break;
...
} The problem is that if I change class name or the namespace of MyClass, the above breaks without generating a compile-time error. The way that I would like to perform the above is by using the type itself, and have "case typeof(MyClass):", but that DOES generate a compile-time error. I am wondering, then, if there is some method like typeof that gets a constant string representing the class name at compile time, so I could change the above code to...
switch (a.GetType().FullName) {
case nameof(int):
...
break;
case nameof(MyClass):
...
break;
...
} This way, I would get compile-time errors instead of run-time errors if I changed the classname but didn't update the above code. Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|