|
My wife has asked me to write an app that will call her cell phone and when she picks up, "speak" a prerecorded message into it. It would be nice to detect if I get her voice mail, so I can press # and then leave the same message there.
I'm not sure how to do this. I've already prepared the message into several MP3 files on my computer. I can use C++ or C# (preferrably), but I don't know what libraries to use for making the phone conversation happen. It would also be nice if I could somehow make the call through an Internet connection, but if that's too complex, I'll settle for dialing out through my modem.
I appreciate any guidance.
Regards,
Alvaro
If you want to get to the top, prepare to kiss a lot of bottom. -- despair.com
|
|
|
|
|
I have to use some control to parse ans show html tags for me, so I decided to use Microsoft Web Browser control, which has a method named Navigate (string url ) that navigates us to the specified url at run-time. But this control hasn't any property like Text or for example Source . therefor, if i generate my html tags at run-time I should first save it as a temporary *.htm file and pass its url to Navigate method! Of course there may be some better way to meet my need, but I don't really know what should I do!
and there is also another component named Microsoft Scriptlet Component
that is not usable for me at all!
Your comments are greatly appreciated!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Reference mshtml.tlb in your project.
Use this code to get the HTML content.
IHTMLDocument2 doc = (IHTMLDocument2) webBrowser.Document;
string text = doc.body.outerHTML;
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I used innerHTML and it worked for me.
Thanks a lot!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hello
I have a programe which fetches it's data (video, audiu, images, ...) from CD on CD Drive. So my programe needs to obtain the name of CD Drive (i:\ ? j:\ ? ...). and also needs to detect whether the correct CD containing required data is in drive or not. whould someone please help me?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hi Meisam.
I email you your answer:
GetDriveType()
Mazy
No sig. available now.
|
|
|
|
|
Hello everyone,
i'm quite new to this c# world so please bear with me
So I have this form and in it I have an editbox in which I must enter a number, in the following form : 119.43. Now, I need this string to be converted to float. Here's how I do it :
float p = System.Single.Parse(prixS);
BUT, I always get a string not properly formatted exception. I tried entering the price with a comma, no can do. Than I tried this :
prixF = (float)System.Single.Parse(prix, System.Globalization.NumberStyles.AllowDecimalPoint| System.Globalization.NumberStyles.AllowTrailingWhite| System.Globalization.NumberStyles.AllowLeadingWhite);
But again same error.
Can someone please help me on this.
Thanks for any help.
Luc.
|
|
|
|
|
My freakin' bad
When fetching the text from the TextBox, I was using this.PriceEdit.ToString()... Ah ah ah !!! Wrong... This got me some undesired text in the string. I found that I need to use the TextBox.Text to access the text entered !!!
Luc.
|
|
|
|
|
I want to do some fun low-level DiskInfo kind of program. I can find how to do the basic stuff like logical drives, file attributes, sizes, etc...
But I also want to get more in depth. How can I get to info like physical drives, file system used, number of file fragments, track size, file slack, etc... ?
Can anyone point me to a library, class, tutorial, article, anything for doing some of these things in C#/.Net ?
Thanks.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Hi,
How to I allocate a dynamic array in run time.
I want to allocate an array, but length of array unfixed.
Please help me.
Thanks.
H.Dung
|
|
|
|
|
Dung,
what do you mean by "length of array unfixed" ?
If you mean that you will not know the length until run-time, consider the following snipplet:
int x = 3;
char[] myArray = new char[x];
This compiles, and thus, even if x was determine by picking user input (or cfg file, or what have you),
you should be able to use it.
If, on the other hand, you need an array whose size will change in time (i.e. starts
with 10 elements in it, but later on you need to add 5 more, and then shrink it to 5, etc etc) then arrays are not
the correct data structure for you. Arrays have "fixed size" (they do not grow in time), but
if you look at the classes in System.Collections you should find something for you.
I often use the Hashtable class (but it's often an overkill!).
HTH,
Frank
|
|
|
|
|
You can simply use ArrayList class.
Use its Add and Remove methods.
this way, you don't need to care about array size, it's completely dynamic
I hope this helps
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hi,
Thank you very much. I have been used the ArrayList class in System.Collections namespace, and I have everything which I need.
H.Dung.
|
|
|
|
|
hey,
I'am looking for some codeexamples for following senario :
My UI is a grid of a collection (but I never use it to add/update or delete records). Under that grid I have a panel with all the information of the selected item (in textboxes, comboboxes,.. - even more information then in the grid).
In this panel there are also 3-buttons (Update,delete and add). So, when I push Update, all the changes made in the panel are refected in my collection and I will redraw the grid. The same for Add and delete buttons.
To fill up the grid I use now:
foreach(Object obj in theCollection)
{ grid.Items.Add(obj.Name);
...
}
Maybe there is a way to bind the collection to the grid and also to bind (???) the data in the panel.
How can I add, update and delete via the buttons through the grid?
I know there are a lot of interfaces Ibindable,Itypedlist,IEditableobject,...
But this is all so confusing that I don't know who to use it all in my senario.
Thanks for any possible help.
|
|
|
|
|
Hi, how would you implement a menu feature with a copy and paste button? I mean, I know textboxes have those functions, but how do you target them? Eg, if a user clicks on my copy button, how do you tell the system from which textbox to copy/paste from?
Also, whats the best way to implement a find feature?
|
|
|
|
|
the IDE notes that :
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
All codes are bellow:
//-------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace test
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private DataTable _table=null;
private DataView _view1=null;
private DataView _view2=null;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGrid dataGrid2;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
init();
}
private void init()
{
DataColumn C1=new DataColumn("id",typeof(int));
C1.AutoIncrement=true;
DataColumn C2=new DataColumn("name",typeof(string));
DataColumn C3=new DataColumn("age",typeof(int));
this._table=new DataTable("Student");
_table.Columns.Add(C1);
_table.Columns.Add(C2);
_table.Columns.Add(C3);
_view1=new DataView(_table);
_view2=new DataView(_table);
this.dataGrid1.DataSource=_view1;
this.dataGrid2.DataSource=_view2;
_view1.RowFilter="id<10";
_view2.RowFilter="id>=10";
_view1.ListChanged+=new ListChangedEventHandler(_view1_ListChanged);
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGrid2 = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(22, 15);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(255, 135);
this.dataGrid1.TabIndex = 0;
//
// dataGrid2
//
this.dataGrid2.DataMember = "";
this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid2.Location = new System.Drawing.Point(288, 14);
this.dataGrid2.Name = "dataGrid2";
this.dataGrid2.Size = new System.Drawing.Size(282, 138);
this.dataGrid2.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(605, 319);
this.Controls.Add(this.dataGrid2);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void _view1_ListChanged(object sender, ListChangedEventArgs e)
{
try
{
_view1.ListChanged-=new ListChangedEventHandler(_view1_ListChanged);
if(e.ListChangedType==ListChangedType.ItemAdded)
{
_view1[e.NewIndex]["age"]=18;
}
_view1.ListChanged+=new ListChangedEventHandler(_view1_ListChanged);
}
catch(Exception Ex)
{
MessageBox.Show(Ex.ToString());
}
}
}
}
//-----------------------------------------------------
|
|
|
|
|
|
hello, I need some help with extending the functionality of the C# save/open file dialogs.
What I would like is to be able to have a file dialog but with some more components than the ones available in the standard open/save dialogs. Now the classes in the Framework are sealed so I can't do it with inheritance. So how do I do it? I really don't know where to start looking.
Can anybody point me in the right direction? It doesn't seem to be the easiest thing to accomplish but it can't be impossible though..
|
|
|
|
|
It looks to me like you can add components using OpenFileDialog.Components.Add(). For Example:
OpenFileDialog opendlg=new OpenFileDialog;
Panel panel=new Panel();
.
.
.
opendlg.Components.Add(panel);
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
It's 6:30pm and it looks like a long night ahead for me. Hopefully someone out there that has had a similar problem can help me.
I am sending emails to our clients via CDO & C#. Here is the code:
CDO.IMessage message = new CDO.MessageClass();
message.TextBody = textbody;
message.HTMLBody = htmlbody;
message.From = fromEmail;
message.To = toEmail;
message.Subject = subject;
message.HTMLBodyPart.ContentTransferEncoding = "7bit";
message.HTMLBodyPart.Fields.Update();
message.Send();
The message is accepted by most SMTP servers, however, some are not accepting the message, claiming that the lines are "not ending with CR/CL". I've been referred to this page by one of the receiving SMTP servers.
"quoted-printable" was not acceptable since it was garbling some of the
links within the email (on links where a dot '.' landed at the end of
the line, before the encoded carriage return. So now I force 7bit encoding and that resolved that issue, however I'm now facing this one.
|
|
|
|
|
I had the same problem when sending plain-text e-mail using the System.Web.Mail.SmtpMail class. The page you were referred to just explains that using bare LF characters (line feed) in an email message sent through SMTP is violation of some specification, and perhaps some SMTP servers seem to tolerate this? (someone who know more about this issue could back me up on this ) I solved the problem by replacing all LF characters by CR-LF (carriage return, line feed) combinations, i.e. if the original string looked like this:
<br />
string textBody="Hello\n\nThis is a message\nThanks";<br />
It should look like this after the correction:
<br />
string textBody="Hello\r\n\r\nThis is a message\r\nThanks";<br />
Hope this helps!
Rado
|
|
|
|
|
Thank you so much for your help Rado!
Do you think the issue is only related to the body of the email, and not the rest of it? Say the mime-headers?
|
|
|
|
|
I'm sorry for the late reply, been pretty busy today. I think that it is related to the whole email message including headers, though I'm not sure. When using the System.Web.Mail.SmtpMail class I never cared about the headers, as this is handled by the class itself, I only had to make sure that the body of the message doesn't contain bare LFs but CR-LF pairs. But I guess that bare LF isn't allowed anywhere in the message.
I hope that you have solved your problems
[EDIT]I did mean the System.Web.Mail.MailMessage class instead of the SmtpMail class [/EDIT]
Rado
|
|
|
|
|
I have searched all over the place to figure out how to run an .exe file from a C# app. Surely there is at least a Windows API out there somewhere that I can call. Can someone help me out?
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
System.Diagnostics.Process.Start(string fileName);
Flight to Redmond - £200
Bulldozer Rental - £100
Destroying the MS campus single handedly for not doing an Academic upgrade, PRICELESS!
-Jonny Newman
|
|
|
|
|