简体   繁体   English

网络共享问题-Delphi

[英]Problems with Tethering - Delphi

good evening! 晚上好! I am trying to make a connection with Tethering, following the explanations of Malcon Groves ( http://www.malcolmgroves.com/blog/?p=1854 ), however I am having the following problem: 按照Malcon Groves( http://www.malcolmgroves.com/blog/?p=1854 )的说明,我试图与网络共享建立联系,但是我遇到以下问题:

When you click Connect, App1 apparently connects, but does not display the App2 handle. 当您单击连接时,App1显然已连接,但未显示App2句柄。

App2 happens the same thing .... .... App2发生相同的事情......

I inserted the tetheringappprofile and tetheringmanager components and made the settings indicated .... 我插入了tetheringappprofile和tetheringmanager组件,并进行了指示设置。

The codes are: 这些代码是:

//App1
procedure TForm1.ConnectClick(Sender: TObject);
begin
 TetheringManager1.AutoConnect;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Caption := Format('App1 : %s',[tetheringmanager1.Identifier]);
end;

procedure TForm1.TetheringManager1PairedToRemote(const Sender: TObject;
  const AManagerInfo: TTetheringManagerInfo);
begin
  Label1.Text := Format('Connected  : %s %s', [AManagerInfo.ManagerIdentifier, 
AManagerInfo.ManagerName]);
end;

procedure TForm1.TetheringManager1RequestManagerPassword(const Sender: TObject;
  const ARemoteIdentifier: string; var Password: string);
begin
  Password := '1234';
end;

.

//App2



procedure TForm1.FormCreate(Sender: TObject);
begin
  Caption := Format('App2 : %s', [tetheringmanager1.Identifier]);
end;

procedure TForm1.TetheringManager1PairedFromLocal(const Sender: TObject;
  const AManagerInfo: TTetheringManagerInfo);
begin
  Label1.Text := Format('Connected : %s %s',[AManagerInfo.ManagerIdentifier,
 AManagerInfo.ManagerName]);
end;

APP1

应用2

Thanks! 谢谢!

When you use AutoConnect to discover other apps, the TetheringAppProfile.Group property in both apps has to be same. 当您使用AutoConnect到探索其他应用程序中, TetheringAppProfile.Group两个应用程式的财产必须是相同的。

Malcolm Groves has indeed great series of articles about App Tethering. Malcolm Groves确实有很多有关App Tethering的文章。 I also attended presentation from Jens Fudge about the subject. 我还参加了Jens Fudge的主题演讲。 Otherwise very hard to master. 否则很难掌握。 Thank you guys! 感谢大伙们!

Delphi ships itself with number of useful samples about App Tethering. Delphi随附了许多有关App Tethering的有用样本。 They are located in directory: ..\\Samples\\Object Pascal\\RTL\\Tethering\\ 它们位于目录中:.. \\ Samples \\ Object Pascal \\ RTL \\ Tethering \\

@Dave: connection through IPv6 should be possible. @Dave:应该可以通过IPv6进行连接。 Did you try AllowedAdapters property? 您是否尝试过AllowedAdapters属性? http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Tether.Manager.TTetheringManager.AllowedAdapters http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Tether.Manager.TTetheringManager.AllowedAdapters

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM