|
Does anyone know how to send message to mobile(Windows phone 7) by using Web service (ASP.NET web service).
Now, I am doing a project about sending message automatically. I found for this, and I knew to API Google, but it only send message to one determine phone number. Can anyone help me?? I want to send message to multi person....Thank you so much!
|
|
|
|
|
You do realise that if you can send a message to one person there, you could just use the same call again to send the message to another person don't you?
|
|
|
|
|
I have downloaded the following code to work from for an app which requires login and registration.
http://code.msdn.microsoft.com/windowsdesktop/CCS-LABS-C-Creating-a-9ba05613/view/Discussions[^]
When I run the code and wish to register I enter my registration details and when I Click on register the MessageBox appear with note "Username can not be empty."
But there is text in the box.
Any suggestions?
Below is the code for the registration form.
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;
namespace ccslabsLogIn.forms
{
public partial class frmRegister : Form
{
#region "Properties"
private bool _Registered = false;
public bool Registered
{
get { return _Registered; }
set { _Registered = value; }
}
private string _Username = "";
public string Username
{
get { return _Username; }
set { _Username = value; }
}
#endregion
public frmRegister()
{
InitializeComponent();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Registered = false;
this.Close();
}
private void btnRegister_Click(object sender, EventArgs e)
{
RegisterUser();
}
private void RegisterUser()
{
if (tbUsername.Text.Length > 0)
{
if (tbPassword.Text != tbRepeatPassword.Text) { MessageBox.Show("Passwords do not match"); RegisterUser(); }
if (tbPassword.Text.Length == 0) { MessageBox.Show("Passwords can not be empty"); RegisterUser(); }
usersTableAdapter.Insert(tbUsername.Text, tbPassword.Text);
Registered = true;
this.Close();
}
MessageBox.Show("Username can not be empty");
RegisterUser();
}
private void usersBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.usersBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.applicationDataSet);
}
private void frmRegister_Load(object sender, EventArgs e)
{
this.usersTableAdapter.Fill(this.applicationDataSet.Users);
}
}
}
Thank you very much.
|
|
|
|
|
Should be something like this, I reckon;
private void RegisterUser()
{
if (tbUsername.Text.Length > 0)
{
if (tbPassword.Text != tbRepeatPassword.Text) { MessageBox.Show("Passwords do not match"); RegisterUser(); }
if (tbPassword.Text.Length == 0) { MessageBox.Show("Passwords can not be empty"); RegisterUser(); }
usersTableAdapter.Insert(tbUsername.Text, tbPassword.Text);
Registered = true;
RegisterUser();
this.Close();
}
else
MessageBox.Show("Username can not be empty");
}
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks a lot that did the trick.
|
|
|
|
|
My vote of one:
What use is this recursive call of RegisterUser() ?
I'd really like to see an explanation for that. In case there is some information missing/empty there will be a recursive call to method RegisterUser which will bring absolutely nothing except locking up the application.
More interesting still is that OP thinks this is a solution (Silent SP alarm goes off!).
Strange!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Didn't notice the call was recursive; it's original location looked flaky too
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hi to all
im want using an extension method in c#
.my code is
public static class Extensions
{
public static string GetFirstThreeCharacters(this String str)
{
if(str.Length < 3)
{
return str;
}
else
{
return str.Substring(0,3);
}
}
}
but when i want t use this extension method icant see "GetFirstThreeCharacters" method in below code?
String str = "my new String";
str = str.GetFirstThreeCharacters();
thank for help
|
|
|
|
|
Make sure you have include the namespace your extension class is in, in the using statements. Your code has to be able to "see" the extension to use it.
|
|
|
|
|
You might want to change this:
if(str.Length < 3)
to this:
if (str.Length < 4)
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I tried the same question but it is working in my app.. check the output rather than intellisence feature....
public static class Exte
{
public static void add(int x, int y)
{
}
public static string GetFirstThreeCh(this string str)
{
if (str.Length < 3)
{
return str;
}
else
{
return str.Substring(0, 3);
}
}
}
class Program
{
static void Main(string[] args)
{
String str = "my new String";
str = str.GetFirstThreeCh();
}
}
|
|
|
|
|
As your code is in the same namespace, it would work. Try moving the extension into a separate namespace and do the same without referencing that namespace when you try to call it.
|
|
|
|
|
ok
this work in my App too
thanks
|
|
|
|
|
i was going through a wcf code and found lots of things was written in app.config file where wcf has been hosted. i just do not understand many things in app.config file regarding wcf. please explain every entry in details....if possible. here is the content
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IViewerService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Mtom"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IViewerService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://97.87.12.242:1003/Rlc/Viewer" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IViewerService" contract="ViewerProxy.IViewerService"
name="BasicHttpBinding_IViewerService" />
</client>
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: please explain every entry in details
You're kidding aren't you? Do you think that anyone here has the time, or the inclination, to answer a question like this. You have all the keywords you need in there, so happy Googling.
|
|
|
|
|
Pete O'Hanlon wrote: Do you think that anyone here has the time, or the inclination, to answer a question like this. Ironic that his profile description reads "I don't have the time".
/ravi
|
|
|
|
|
That would take a small book to explain, FAR more than allowed in a few forum posts.
Do yourself a favor and pick up a book on WCF and teach it to yourself.
That is, unless "you don't have the time". In which case you wouldn't have the time to read the pile of forum posts that would be required to explain all of this anyway.
|
|
|
|
|
After 10 Hour shift + only 4 hours sleep in a rough night
now an hour before my shift ends i think i lost a fuse... anybody can give me hint on this one?
Link
[^]
Hmm i wonder why its doing that......ARGHS NO STOP, ROLLBACK ROLLBACK...F*** That's how i learned to "Always Backup"!!
Dogs are man's best Friend,
Cats are man's adorable little serial killer
|
|
|
|
|
Why have you posted this? Your question is in the queue and will be answered when someone feels they have something useful to add. Bottom line: please be patient.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Questions from Q&A are usually not repeated/linked to on the forum.
I cannot give a hint, as I don't know what direction; let's assume it's UI-wise, you'd want two lists with columnnames, where the right side can be manipulated easily.
The question is rather whether you, or the end-user should do the final mapping. I'd assume that it'd be hard to predict every situation, and hence suggest to let the user decide, if possible.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
This has to do basically the same thing, although it is an Excel Addin instead of just reading Excel. However, can use a lot of the code pretty much directly if you are willing to spend the time to understand what the code is doing: Excel Add-in Framework for Validating and Exporting Data[^]
|
|
|
|
|
In my applications (generally WinForms) I am currently using Log4Net to allow me to use application logging.
my question is that currently I log at exception levels, but I feel that this level of logging is not enough.
what I am asking is advice / help or even pointers to a good logging strategy.
Thanks
Simon
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
As with most things: it depends. I have worked on systems which can log just about everything that happens in the program to those that do not properly log (or catch) exceptions. One of the options you could try is to add code that will log every method call, entry and exit, including parameters and return values, but make it optional, so you only enable it when trying to locate a problem. You can also try logging particular types of activity based on flags or debug levels etc.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Good advice.
It might also depend upon what the application is doing. For instance, on a windows service, I tend to log everything because it might be useful to have a record of what is going on each time the application carries out its tasks and to check that it has done so properly.
All according to need. I also use log4Net: pretty good piece of kit.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Thanks Richard,
what you have suggested makes a lot of sense.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|