本文整理匯總了C#中Shadowsocks.Model.Server.setObfsData方法的典型用法代碼示例。如果您正苦於以下問題:C# Server.setObfsData方法的具體用法?C# Server.setObfsData怎麽用?C# Server.setObfsData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shadowsocks.Model.Server
的用法示例。
在下文中一共展示了Server.setObfsData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SaveOldSelectedServer
private int SaveOldSelectedServer()
{
try
{
if (_oldSelectedIndex == -1 || _oldSelectedIndex >= _modifiedConfiguration.configs.Count)
{
return 0; // no changes
}
Server server = new Server
{
server = IPTextBox.Text,
server_port = int.Parse(ServerPortTextBox.Text),
password = PasswordTextBox.Text,
method = EncryptionSelect.Text,
obfs = ObfsCombo.Text,
obfsparam = textObfsParam.Text,
remarks = RemarksTextBox.Text,
tcp_over_udp = CheckTCPoverUDP.Checked,
udp_over_tcp = CheckUDPoverUDP.Checked,
protocol = TCPProtocolComboBox.Text,
obfs_udp = CheckObfsUDP.Checked,
id = _SelectedID
};
Configuration.CheckServer(server);
int ret = 0;
if (_modifiedConfiguration.configs[_oldSelectedIndex].server != server.server
|| _modifiedConfiguration.configs[_oldSelectedIndex].server_port != server.server_port
|| _modifiedConfiguration.configs[_oldSelectedIndex].remarks_base64 != server.remarks_base64
)
{
ret = 1; // display changed
}
Server oldServer = _modifiedConfiguration.configs[_oldSelectedIndex];
if (oldServer.server == server.server
&& oldServer.server_port == server.server_port
&& oldServer.password == server.password
&& oldServer.method == server.method
&& oldServer.obfs == server.obfs
&& oldServer.obfsparam == server.obfsparam
)
{
server.setObfsData(oldServer.getObfsData());
}
_modifiedConfiguration.configs[_oldSelectedIndex] = server;
return ret;
}
catch (FormatException)
{
MessageBox.Show(I18N.GetString("Illegal port number format"));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return -1; // ERROR
}