![]() ![]() This is actually a much smaller version of code made for a much larger project for some specific purpose for sending bulk SMS to fellow Team Members.Boost your WhatsApp marketing efforts with WA Bulk Sender, the efficient and powerful tool for sending bulk messages. It will give lots of help to explore system information. Let the SMS begin !!! :-) Points of Interest Setting Cells Background color to GREEN which passes // above validations elseĭ.BackColor = Color.Green Setting Cells Background color to RED if above // Error Found in Any of the cellsĭ.BackColor = Color.Red On Check Values button below code will check cell values // One By One and set the color either RED or GREEN // if IF STATEMENT passes private void button7_Click( object sender, EventArgs e) ![]() Simple, isn't it? If not, send me a question and I will be glad to help you out.Īnd for extra spice, I have added simple checking when Excel File is loaded into DataGridView when CHECK VALUES button is clicked, it will check for NULL VALUES and Message text more than 160 Characters and highlighted cells to RED if an error is found, or else cells will be green if no error is found.įor achieving cell checking, a simple yet once again FOR LOOP will do the magic. MessageBox.Show( " T O T A L - M E S S A G E - S E N T = " + i, Sleeps system for 1000ms for refreshing GSM Modem / Phone Pdu3 = new SmsSubmitPdu(MMessage, MSMS_Number, " ") MessageBox.Show( " Data Imported Successfully.!!!\r\n\nĬheck Imported Values & SEND SMS.!!!!",Įxcel FIle\r\n\nKindly Check Worksheet Name",Īfter loading Excel file into the DataGrid, we'll only use the For Loop function to get CELL NUMBER & MESSAGE one by one and send it using very simple code just like for sending a single SMS message.įor (i = 0 i < dataGridView1.RowCount - 1 i++) Label25.Text = " Total SMS In Excel File " + rows_counting There Should Be Only Two Columns in Sheet Like Below\r\n\nĬELL NUMBER | MESSAGES", " Error", MessageBoxButtons.OK, MessageBox.Show( " Kindly Check Column Count Rows_counting = dataGridView1.RowCount - 1 Ĭolumn_counting1 = dataGridView1.ColumnCount OleDbDataAdapter dataAdapter = new OleDbDataAdapterĭataGridView1.DataSource = dataSet.Tables ĭataGridViewAutoSizeColumnsMode.DisplayedCells OpenFileDialog dialog = new OpenFileDialog $]", " SMS") ![]() Below code on button click will Open File Select Dialog Box // for Excel File which contains Sheet name SMS and only two columns named // CELL NUMBER and MESSAGES which will be loaded in to DataGridView // Also you need to rename your Excel sheet to SMS because // it is also checking that sheet name private void button3_Click_1( object sender, EventArgs e) Try GSMComm connection with the values got from the DataGrid when Cell is Clicked. As shown below, a Confirmation message will appear and Connected device information will also be shown and DataGrid Cell will be highlighted green. If you get all the COM Port Information from system without error, then the second step is to connect to the device, click on the Cell of Data Grid of your desired device to connect. Object connstatus = queryObj ĭ(capdeviceid, captionObj, New ManagementObjectSearcher( " root\\CIMV2",įoreach (ManagementObject queryObj in searcher.Get()) // Here we are getting the all available information from the Win32_SerialPort // and setting it in to the DataGrid try ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |