|
LOL - it's been 2 years for me, but I'm feeling pretty desperate.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how can i build a simple sms server.
|
|
|
|
|
How can i send sms through a mobile phone that will be connected in the usb port...
|
|
|
|
|
See here[^] for web services that will let you send SMS without needing a USB phone.
Not exactly what you are asking for, but it might help.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Is there a way to dynamically create controls using a For loop?
So for instance if you wanted 4 RichTextBox controls instead of writing lines a code for each control can you not use a loop to create them?
Something like:
for (int i = 1; i < 5; i++)
{
((richbox)i) = new System.Windows.Forms.RichTextBox();
}
So that you end up with 4 RichTextBoxes:
richbox1
richbox2
richbox3
richbox4
Any help appreciated..
|
|
|
|
|
Only if you want to keep your reference to them in an array, or you want to write ugly reflection code. If you create an ArrayList to hold them, then it's easy.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The best you can do is this:
RichTextBox[] richBoxes = new RichTextBox[4];
for(int i = 0; i < 4; i++)
{
richBoxes[i] = new RichTextBox();
} And you'll end up with 4 RichTextBox es: richBoxes[0] , richBoxes[1] , richBoxes[2] , and richBoxes[3] .
I hope this helps.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
how to develop the calendar that can be add/edit message/data inside the calendar itself?
|
|
|
|
|
Hi,
I have multiple accounts setup in Outlook. I would like to retrieve and change them. Does any know how to do this?
Regards, nidkil
|
|
|
|
|
Hi guys
thankx in advance
I am trying to craete a user control which has datagrid in it, I want to pass datareader to this control and load it accordingly and then hide the columns (by passing params again) which i dont want user to see.
I can see that my datareader is available in my User control but it doesnt load the data grid or throw any exception. I am using C# and ASP.NET for this.
Help is urgently required
.... this is the user control code behind.......
public partial class Data : System.Web.UI.UserControl
{
public SqlDataReader drVal = null;
protected void Page_Load(object sender, EventArgs e)
{
setGrid();
}
public Boolean setGrid()
{
try
{
if (drVal.HasRows)
{
dgDataGrid.DataSource = drVal;
dgDataGrid.DataBind();
drVal.Close();
return true;
}
else
{
return false;
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
return false;
}
}
}
|
|
|
|
|
Hi,
Just out of curiosity, is your datareader having data at the time you are trying to bind the reader to the grid.
If it doesnt have any data it may not throw an error as well as you wont see anything.
Let me know
|
|
|
|
|
I have a Form which references another form within the same namespace eg:
Form2 frm2 = new Form2();
Form2 needs to be opened more than once.
I open the form when a button is clicked with:
frm2.Show();
After closing frm2 and clicking on the button to open the form again I get the following error:
Cannot access a disposed object named "Form2".
I can get around this by using frm2.ShowDialog() only problem being that the second time the form is opening the layout is all messed up as though the controls were not disposed when the form was closed.
How can I ensure that the form can be opened multiple times??
|
|
|
|
|
It sounds like you're declaring frm2 within your click handler and then calling it again once the object has gone out of scope. My suggestion would be to promote frm2 to a local variable and then instantiate it in the constructor. Then, when you handle your button click event, you can call Show(). Try something like this:
public class Form1
{
Form2 myForm2;
Button myButton;
public Form1()
{
myForm2 = new Form2();
myButton = new Button();
myButton.Click += new EventHandler(myButton_Click);
}
private void myButton_Click(object sender, EventArgs e)
{
myForm2.Show();
}
}
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them...
[RLtim] Newsflash! Kids aren't afraid of bunnies.
[Cheshire] Oh they will be...
-Bash.org
|
|
|
|
|
This gives the same error.
I changed the code to match what you have.
If I use:
myForm2.ShowDialog(); instead of myForm2.Show(); it works only the layout of controls on the form are messed up. For example instead of one OK button there are two of them.
|
|
|
|
|
Hi
I did this:
Form2 frm2; // Class level variable
private void button1_Click(object sender, System.EventArgs e)
{
frm2 = new Form2 ();
frm2.Show();
}
And added a Form named Form2 and it works fine. Even you close the form2 and click on the button still it creates a new form.
Please let me know if I am missing something.
|
|
|
|
|
Yeah that works fine. Thanks for your help
|
|
|
|
|
I am building a component to imitate the windows connection manager
so we can use dialup and dsl.
Anybody know how to use PPPoE using rasapi32.dll in C#?
Any help is appreciated.
Devi
|
|
|
|
|
The System.Web class has been deprecated in .net 2.0... So the email code I've been using no longer works.
After some tinkering, I got the System.Net class to send the email, however... It wont actually send the mail until I exit the program. Whats the deal with that?
The function finishes with no errors. I can wait and nothing happens. Then the moment I close the program, the email leaves my machine. I know this because Norton scans outgoing emails.
Anybody?
|
|
|
|
|
System.Web is not a class, it's a namespace. Are you sure that it's deprecated? It contains everything that has to do with asp.net, so it doesn't seem likely. Even if it were deprecated it doesn't mean that it's removed, so the code should still work. Why do you think that it doesn't work?
From what you descibe of your problem, it sounds like mail is not sent until the object is collected by the garbage collector. Are you closing and disposing the objects you use properly?
---
b { font-weight: normal; }
|
|
|
|
|
System.Web.Mail and its containing classes have been deprecated in Whidbey. System.Net.Mail is the new location for some much improved e-mail classes.
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them...
[RLtim] Newsflash! Kids aren't afraid of bunnies.
[Cheshire] Oh they will be...
-Bash.org
|
|
|
|
|
Yes, that makes much more sense.
[ot]
Why did they put mail in the web namespace in the first place?
[/ot]
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote:
From what you descibe of your problem, it sounds like mail is not sent until the object is collected by the garbage collector. Are you closing and disposing the objects you use properly?
I'll look at that... thanks!
I'm still new at this!
|
|
|
|
|
<br />
private void SendBill()<br />
{<br />
SmtpClient client = new SmtpClient("my.mailserver.net");<br />
MailAddress toAddr = new MailAddress("anybody@hotmail.com");<br />
MailAddress fromAddr = new MailAddress("test@mailserver.net");<br />
MailMessage message = new MailMessage(fromAddr, toAddr);<br />
message.Subject = "Test Mail";<br />
message.Body = "This is a test.";<br />
client.Send(message);<br />
}<br />
This is the code. I changed the server and addresses to post here.
|
|
|
|
|
Have you tried disabling Norton's e-mail scanning? I've been using the new mail classes in an app here and it works as soon as I call Send().
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them...
[RLtim] Newsflash! Kids aren't afraid of bunnies.
[Cheshire] Oh they will be...
-Bash.org
|
|
|
|
|
I've had the same issue, only way round it i've found is to set the message to null and the smtp instance to null and then call GC.Collect();
MailMessage msg = new MailMessage(adminEmail, adminEmail);
SmtpClient smtp = new SmtpClient();
smtp.Host = "xxx.xxx.xxx.xxx";
smtp.Port = 25;
smtp.Send(msg);
smtp = null;
msg = null;
GC.Collect();
|
|
|
|