i am developing a server-client program in which server will be showing datas sent by client across a network. without Authentication it works fine but once i give authentication i am not able to get datas from client.client is a winfrom application.i know that client must be given authorization to put data into server.can anyone tell me how to do that?i am developing based on the link given below
blog.bobcravens.com/2009/11/browse-files-on-remote-computers
posting server side authentication code
Code:<authentication mode="Forms"> <forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH"> </forms> </authentication> <authorization> <deny users = "?"/> </authorization>
login.aspx
i have written validation code also.everything works fine on the server side but not able to get data from client side..Code:<script runat="server"> Sub Login_Click(ByVal sender As Object, ByVal e As EventArgs) If ((UserEmail.Text = "[email protected]") And _ (UserPass.Text = "000")) Then FormsAuthentication.RedirectFromLoginPage _ (UserEmail.Text, Persist.Checked) Else Msg.Text = "Invalid credentials. Please try again." End If End Sub </script>
client program is written in c#,client-server communication is via http post.
code below is how client register with the server.
Code:private void Register() { // Register with the server. RegisterMessage registerMessage = new RegisterMessage { ComputerName = Environment.MachineName, TimeStamp = DateTime.Now, UserInfo = Environment.UserDomainName + "\\" + Environment.UserName }; PostMessage(registerMessage); } private void PostMessage(BaseMessage message) { BaseMessage[] messages = null; try { messages = _webService.Poll(message); } catch (Exception ex) { // Service must be down. // MessageBox.Show(ex.ToString()); _pollMode = PollModeOptions.Register; }
request to server is done based on the link below.


Reply With Quote

