|
hello Monica,
i didn't find solution using WMI......
if you suggest me any WMI class dan i'll try again..
thank u
|
|
|
|
|
Hello. I need to develop an sms application to send sms to all customers phone numbers immediately an item comes into stock. Please i need to understand the basics. How to cut out sms resellers and develop my own. please its important and urgent.
Thank you for your anticipated response and clear help.\
kind regards
hassan
stay jacking
|
|
|
|
|
Hi
just try out way2sms free api.
use predefined commands and function to send sms
|
|
|
|
|
For a heads-up, you need to get a GSM modem (or a CDMA modem), attach it to your PC and use the API provided with the modem to send SMS.
And do not use words like "important" or "urgent" here. People in CP help others in their leisure, it may be urgent for you, but not for us here.
|
|
|
|
|
Don't cross post. Read the forum guidelines. Pick one forum and use it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I actually used this feature provided in VB.NET, as a project for a break alarm here at work. It was made to notify people of the breaks about to end 5-10min prior to the end of the break. Of course it was used through via Email the mobile number. So the down side is, is that people had to use their email account credentials to setup the automatic notification. Of course the contrast in this to match what he expects would to be setting up a generic email account and of course applied directly to the code for the notification. At least that is my 2 copper. The implementation is very easy and with just a few lines of code. Use c# > vb for better management. But for unfamiliarity use the vb.net
|
|
|
|
|
Code for VB.NET
<pre>
Try
Dim insMail As New MailMessage()
With insMail
.From = strFrom
.To = strTo
.Subject = strSubject
.Body = strBody
.Cc = strCC
If Not strAttachments.Equals(String.Empty) Then
Dim strFile As String
Dim strAttach() As String = strAttachments.Split(";")
For Each strFile In strAttach
.Attachments.Add(New MailAttachment(strFile.Trim()))
Next
End If
End With
If Not strSMTPServer.Equals(String.Empty) Then
SmtpMail.SmtpServer = strSMTPServer
End If
SmtpMail.Send(insMail)
Catch e As Exception
Console.WriteLine(e.Message)
End Try
</pre>
Then pick from the list in which your employees have the provider:
<a href="http://en.wikipedia.org/wiki/List_of_SMS_gateways">SMS Gateway Listing</a>
The code is easily converted to c#
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
namespace EmailSMS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
MailMessage SMS = new MailMessage();
SmtpClient SMTP_Server = new SmtpClient(SMTP_Server_Name);
SMTP_Server.Credentials = new System.Net.NetworkCredential(userName, password);
SMS.From = SMS_From;
SMS.To = SMS_To;
SMS.Subject = SMS_Subject;
SMS.Body = SMS_Body;
SMTP_Server.Port = SMTP_Port;
SMTP_Server.EnableSsl = true OR false;
SMTP_Server.Send();
MessageBox.Show("SMS St Successfully!");
}
catch (Exception ex)
{
MessageBox.Show("Error while trying to send SMS.\n\nError: ", ex.ToString());
};
}
}
}
In C#, Cutting out the SMS re sellers is like telling your employees to give up their carriers and switch to yours when you can't provide a reliable service. Use the generic email system, it helps and is less of a hassle. What I provided is a breakdown of what you can accomplish with the code. Its not much, so make use of it.
|
|
|
|
|
i have Webservice that connect and copy file to 30 terminals
after 10 terminal that copy the file - i get no connection.
but if i stop and start the webservice it works great.
the webservice is on Windows-XP with 1G memory
what can be the problem ?
thanks in advance
|
|
|
|
|
Windows XP only allows 10 inbound TCP/IP connections at any one time.
You'll have to move your webservice to Windows Server to get more simultaneous connections.
|
|
|
|
|
Further to Dave's post, here is a support bulletin that details this limit; http://support.microsoft.com/default.aspx?scid=kb;EN-US;314882[^]
You could always modify the web service to batch the copy operations out to the remote terminals.
What if one terminal is offline? does the service fail,, how does it know to carry on etc. etc.
You should be building some sort of queue that pumps the file out, if it experience a problem with any given workstation it moves onto the next, it then would go round the list of failed nodes and keep doing this until they are all complete.
|
|
|
|
|
Hey Guys,
I'm working on a webapplication and I'm saving files .pdf in a folder called "Files" inside of the application project...
So, I display these pdf files but I got a nasty problem, with delete them, It's driving me nuts....
because I every time I try to do it, I get this exception:
"File does not exist", It couldn't be found... BUT the goddamned File does exist..
In fact, I display this pdf file (with response.transmitfile) with the same string path and It works... but when I try to delete it with the methos from IO.. It doesn't work at all..
Here' part my code:
string path = @"\Files" + "\\" +filename.pdf;
if (File.Exists(path))
{
File.Delete(path);
elimino = true;
}
So, anybody knows how can I solve this problem???
Thanks...
|
|
|
|
|
phisco123 wrote: string path = @"\Files" + "\\" +filename.pdf;
if (File.Exists(path))
Maybe that's just a typo when you posted the message, but do you even have a variable named filename.pdf ? What is the value of your path variable? If the actual filename is left off, then the path would exist, but you would be trying to delete a directory, not an actual file.
Of course, if it was just a typo in the message, it could be something else.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Because you have a backslash at the beginning, which means the search starts from the root of the drive. For example, if your web root is locally on the C: drive, then you're code is looking for C:\Files\whatever. I doubt that's what you want.
If your files root is under your web application root - not generally a good idea since people then have direct access at least for file extensions not configured with your server software (ex: IIS) - you can use ~ to resolve the path like so:
string root = Server.MapPath("~/Files");
string path = Path.Combine(root, filename);
if (File.Exists(path))
{
File.Delete(path);
}
It's also a good idea to use Path.Combine, which works on any manage host environment (though Windows is most typical) and takes care of any trailing backslashes since double backslashes in some use cases can cause problems (referencing back to root, for example).
This posting is provided "AS IS" with no warranties, and confers no rights.
Program Manager II
Visual Studio Professional Deployment Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Don't forget ... MS best practice[sic] is merely:
try{
File.Delete(path);
}
catch{}
Considering the file can be deleted between the File.Exist and File.Delete calls by another process.
|
|
|
|
|
The user could also try setting a static setting of the directory location within his application under compile options and then just specify the file name which he is trying to delete.
Try creating a setting, string string ie: string FilePath = "%USEPROFILE%.\\Desktop\\DirectoryToFile\\" (or where ever your path is located)
Then in your application just add the Filename to the path, so that way you know that your application is pointing to the location, it would be concrete. Of course however if it is still saying that the file doesnt exists, make sure you are spelling it correctly and including the applications extension(which I'm not saying you aren't) and make sure you use the Try::catch, which is vital in this situation.
<pre>
String FILE_TO_DELETE = FilePath+FileName;
Try
if.exists(FILE_TO_DELETE) then
FILE_TO_DELETE.delete
end if
catch ex as exception
msgbox("Unable to delete file. Reason: ", ex);
end try
</pre>
And with the benefit of setting a static path in your program, you can change the path at anytime and save its settings easily. because as long as your code includes the "String FILE_TO_DELETE = FilePath+FileName;" That string will always change, just not your code.
|
|
|
|
|
Heath Stewart wrote: Because you have a backslash at the beginning, which means the search starts
from the root of the drive. For example, if your web root is locally on the C:
drive, then you're code is looking for C:\Files\whatever. I doubt that's
what you want. If your files root is under your web application
root - not generally a good idea since people then have direct access at least
for file extensions not configured with your server software (ex: IIS) - you can
use ~ to resolve the path like so:
<SPAN class=code-comment>
</SPAN>string root = Server.MapPath(<SPAN class=code-string>"</SPAN><SPAN class=code-string>~/Files"</SPAN>);
string path = Path.Combine(root, filename);
<SPAN class=code-keyword>if</SPAN> (File.Exists(path))
{
File.Delete(path);
} It's also a good idea to use Path.Combine, which works on any
manage host environment (though Windows is most typical) and takes care of any
trailing backslashes since double backslashes in some use cases can cause
problems (referencing back to root, for example).
Thanks man, That was it
|
|
|
|
|
Hello,
I have written a 2 page program. The first page connects to a remote database so that queries can be run from the second page. Once the connection is established, that second page is navigated to using a button that calls the ShowDialog command. On the second page, I construct a query from an assortment of listview boxes and send the results to a DataGridView. So far so good....everything works to this point. Now, I have a rich text box that shows the final SQL statement that was used to create the GridView. I want to be able to modify the command manually and run it again to get new results without leaving this page...seems simple enough...however, when I try to run the command the second time using a different run button, the first page reappears when the code is completed. I stepped through it and found that the program is sending me back to the first page and stopping in the button code that called the ShowDialog command; and then I am stuck there. I do not know why I am being forced to leave the second page and why the code doesn't simply run and put the new information into the DataGrid. Please tell me where I am going wrong.....Thank you in advance....Pat
|
|
|
|
|
Well, at a rough guess I would say there is either a code bug or a logic error in your program. However, without seeing some of your code it's difficult to be more precise.
The best things in life are not things.
|
|
|
|
|
Richard,
Thank you for your reply....Yes, I agree with your input. There was so much code on this that I did not think it was OK to show it all, so I did not. I think that Bob (below) has an idea regarding the modality so I will pursue that line right now. In the meantime, I created a work around (which did not fix the issue but allowed me to get the desired result a different way). I wanted to reply though and thank you for taking the time to assist. I know you time is valuable and I appreciate it.
Best Regards, Pat
|
|
|
|
|
No worries, hope you resolve your problem.
The best things in life are not things.
|
|
|
|
|
ShowDialog returns when the form it calls is closed. So either the event handler on the second button is closing the modal form (directly or indirectly), or you have set a DialogResult on that button (which causes it to close the form).
|
|
|
|
|
Bob,
Thank you for your reply. I will further examine the code as per your suggestion and post the solution if I am able to correct it. In the meantime, I have created a work around to solve the immediate problem, but I will not be happy until I understand the "why" of it so I can do it correctly next time.
Best Regards, Pat
|
|
|
|
|
this message apper to me
invalid object name 'ControlMessage'
|
|
|
|