Saturday, October 19, 2013

webrequest gadgeteer

I had a similar problem and fixed it with
request.KeepAlive = false;

http://geekswithblogs.net/WindowsEmbeddedCookbook/archive/2009/01/16/http-request-class-for-the-.net-microframework.aspx

http://netmftoolbox.codeplex.com/SourceControl/latest#Samples/Visual C#/SMTP Client/Program.cs


http://netmftoolbox.codeplex.com/wikipage?title=Toolbox.NETMF.NET.HTTP_Client&referringTitle=Available%20classes

Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress

http://forums.netduino.com/index.php?/topic/2964-every-2nd-webrequest-fails/

webRequest.AllowAutoRedirect = true;
*****
private static void InitNetworking()             {                 // First Display some information about networking                 NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();                 if (networkInterfaces.Length == 0)                     return;                 foreach (NetworkInterface ni in networkInterfaces)                 {                     if (ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)                     {                         ni.EnableStaticIP("192.168.0.253", "255.255.255.0", "192.164.0.244");                         ni.EnableStaticDns(new string[] { "4.2.2.1", "4.2.2.2" });                         //ni.EnableStaticIP("192.168.253.2", "255.255.255.0", "192.164.243.1");                         //ni.EnableStaticDns(new string[] { "4.2.2.1", "4.2.2.2" });                     }                 } - See more at: https://www.ghielectronics.com/community/forum/topic?id=12552&page=2#sthash.qdM6vyGs.dpuf

http://netmftoolbox.codeplex.com/wikipage?title=Toolbox.NETMF.NET.SMTP_Client

*********
private void testHttpGet(){
 var ServerName = "google.com";
 var HttpClient webClient = new HttpClient(new IntegratedSocket(ServerName, 80)); }
 var response = WebClient.Get("/");
 if(response.ResponseCode != 200) {//Something went horribly wrong in the ether
  Debug.Print("FARK!!!!");
  continue;
 }
 //HTTP Sucess parse response
 if(response.ResponseBody == "\r\n\r\n"){//Empty Response Body Discard
  continue;
 }
 Debug.Print(response.ResponseBody);
}

***********
<%@ Page Language="C#" AutoEventWireup="true"  ValidateRequest="false" %>

<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "System.Text" %>
<%@ Import Namespace = "System.Net" %>
<%@ Import Namespace = "System.Net.Mail" %>
<%@ Import Namespace = "System.IO" %>

<%@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="cc1" %>





   
   
     


   

    <% if (isPreview) {%>
   

    <%} %>
   

   
   
   
">

   
Back to Custom Greetings

   
   
   

   
    greetings image
   
   

   
    Your Email:
   
            ID="RegularExpressionValidator1" runat="server" ErrorMessage="Please enter a valid email address" ControlToValidate="YourEmail" validationexpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
        CssClass="validmargin0">

       
       
   
     

        Recepient Email:
     
                ID="RegularExpressionValidator2" runat="server" ErrorMessage="Please enter a valid email address" ControlToValidate="RecepientEmail" validationexpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
        CssClass="validmargin0">

               

   
    

    Your Name:
            runat="server" Width="180px" TabIndex="3">
                    runat="server" ErrorMessage="You must enter a message for the greeting." ControlToValidate="eBody" CssClass="validmargin0">
   
   
   

    Your Message:
     
   
   
   
   
   

                onclick="Preview_Click"  OnClientClick="javascript:CopyText();" TabIndex="5"/>
       
       

   
   
        
        <% if (isPreview) {%>
       
        <%=BuildGreeting()%>
       
       
 

       

           

               
               
           
       
       
        <%} %>
   
   
   
   



<% if (!isPreview) {%>


<%} %>


    <% if (isPreview) {%>
   
    <%} %>
   






***
http://en.kioskea.net/forum/affich-178809-how-to-connect-internet-with-sim-card
*****
Development tool : Microsoft Visual C# Express 2010
Micro framework:  Microsoft .NET Micro Framework 4.1 SDK
The Gadgeteer core, mainboard SDk and module driver(GHI)

No comments: