Skip to content

how to get user current location in web based bot using direct line c# #1049

@UsamaAslam

Description

@UsamaAslam

hi,
i am working on a bot in which i have to display offers to the user according to their current location.
i use this method to get user IP address :

String ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(ip))
{
ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}

but user IP that code Fetch is totally wrong ..

Is their any correct method to get user current location in bot framework C#.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions