Use User-Agent C# for divices Android and iOS -


i have 2 buttons 1 download .apk , download .ipa, in homecontroller have:

    [httpget]     public fileresult downloadios()     {        var filename = ("app.ipa");        var filepath = $"apps/{filename}";        byte[] filebytes = system.io.file.readallbytes(filepath);        return file(filebytes, "application/ipa", filename);       }      [httpget]     public fileresult downloadandroid()     {         var filename = ("app.apk");         var filepath = $"apps/{filename}";         byte[] filebytes = system.io.file.readallbytes(filepath);         return file(filebytes, "application/apk", filename);     } 

what want can not download android device ios app , vice versa. use user-agent example:

    if (useragent.contains("android"))     {         clientosname = getosversion(useragent, "android");         ....     }      else (useragent.contains("iphone"))     {         clientosname = getosversion(useragent, "iphone");         ...     } 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -