System.Tether.AppProfile.TTetheringAppProfile.SendString
Delphi
function SendString(const AProfile: TTetheringProfileInfo; const Description, AString: string): Boolean;
C++
bool __fastcall SendString(const System::Tether::Manager::TTetheringProfileInfo &AProfile, const System::UnicodeString Description, const System::UnicodeString AString);
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
function | public | System.Tether.AppProfile.pas System.Tether.AppProfile.hpp |
System.Tether.AppProfile | TTetheringAppProfile |
Description
Envoie la chaîne spécifiée vers le profil distant spécifié.
Cette fonction reçoit les paramètres suivants :
AProfile
est le profil distant qui reçoit la chaîne.Description
est une description du contenu de la chaîne.AString
est la chaîne à envoyer.
Le profil distant reçoit la chaîne comme un paramètre de la commande "envoyer la chaîne", il n'est donc pas nécessaire pour le profil distant d'accepter et de recevoir la chaîne séparément (comme dans le cas de SendStream). Cela signifie que le profil distant ne peut pas choisir de recevoir la chaîne ou pas.
La fonction renvoie True
si le profil distant reçoit la commande.
SendString est une fonction synchrone. Cette fonction soumet une demande au profil distant, et son exécution se termine uniquement après l'obtention d'une réponse de la part du profil distant. Vous pouvez, si vous le souhaitez, utiliser un thread distinct pour exécuter cette fonction.
Exceptions
Un appel de SendString peut déclencher l'une des exceptions suivantes :
Exception | Exception.Message | Scénarios |
---|---|---|
Profil <identificateur de profil> n'est pas connecté. |
| |
Aucune connexion disponible pour <l'identificateur de profil> |
| |
Impossible d'obtenir une connexion au profil <identificateur de profil>. |
| |
Impossible de se connecter au profil <identificateur de profil> |
|
Voir aussi
- System.Tether.AppProfile.TCustomRemoteItem.IsTemp
- System.Tether.AppProfile.TTetheringAppProfile.OnAcceptResource
- System.Tether.AppProfile.TTetheringAppProfile.OnResourceReceived
- System.Tether.AppProfile.TRemoteResource
- System.Tether.AppProfile.TRemoteResource.Value
- System.Tether.Manager.TTetheringProfile.Manager
- System.Tether.Manager.TTetheringManager.RemoteProfiles
- Exemple BDShoppingList
- Exemple MediaPlayer