Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

Patricio Tapia

@Patricio Tapia
About
Posts
24
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# and NUSOAP, blank results
    P Patricio Tapia

    Hi i'm working in a C# client proyect, that client call SOAP methos from a PHP NUSOAP this is the method using in PHP (nusoap)

    require\_once('lib/nusoap.php');
    $server = new soap\_server();
    $ns='http://localhost/';
    $server->configurewsdl('ApplicationServices',$ns);
    $server->wsdl->schematargetnamespace=$ns;
    $server->register('prueba',array('texto' => 'xsd:string'),array('return' => 'xsd:string'),$ns);
    $POST\_DATA = isset($GLOBALS\['HTTP\_RAW\_POST\_DATA'\])
                ? $GLOBALS\['HTTP\_RAW\_POST\_DATA'\] : '';
    

    // pass our posted data (or nothing) to the soap service
    $server->service($POST_DATA);

    function prueba($texto) {
    	$var1 = "Tu texto es: " . $texto;
    	return $var1;
    }
      exit();
    

    ?>

    well, the soap code works fine. Now, the C# client

    namespace soap1
    {
    [System.Web.Services.WebServiceBinding(Namespace = "http://localhost/", Name = "ApplicationServices")]
    public class localhost1 : System.Web.Services.Protocols.SoapHttpClientProtocol
    {

        \[System.Diagnostics.DebuggerStepThrough()\]
        public localhost1()
        {
            this.Url = "http://localhost/logeo.php";
        }
    
        \[System.Web.Services.Protocols.SoapDocumentMethod("http://localhost/logeo.php",
            RequestNamespace = "http://localhost/",
            ResponseNamespace = "http://localhost/",
            Use = System.Web.Services.Description.SoapBindingUse.Literal,
            ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)\]
    
        public string prueba(string texto)
        {
            object\[\] resultado = this.Invoke("prueba", new object \[\] { texto });
            return(Convert.ToString(resultado\[0\]));
        }
        //\[System.Diagnostics.DebuggerStepThrough\]
    

    }

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1\_Click(object sender, EventArgs e)
        {
            localhost1 app1 = new localhost1();
            string s = app1.prueba("pato");
            MessageBox.Show(s);
        }
    

    }
    }

    now, the c# code here, works fine and they detect my php method ¿the problem? well, in that line

    string s = app1.prueba("pato");

    the "s" variable has in blank, no result, no value return i test the SOAP server code in a SOAP client code and works fine, return a string value, but in this c#, no string value returns. why?? :confused: NOTE: Sorr

    C# wcf csharp php sysadmin data-structures

  • Access to soap WebServer without "Add Web Reference" Option
    P Patricio Tapia

    Hi I'm working in a webserver (php code) and all works fine using the "Add Web Reference" option. Question, HOW i can add a Web Reference with code??? (because ... well, maybe the host change the IP address). NOTE: Using Nusoap, PHP and C#

    C# question csharp php wcf xml

  • "pack" and "unpack" php method in C#, how?
    P Patricio Tapia

    Hi i have days trying to create a method to work like "pack" method in php some idea or guide to how? i'm tired thanks

    C# csharp php tutorial question

  • ListView: set "BackColor" in a SubItem
    P Patricio Tapia

    I have a problem: if (radioButton1.Checked) a.SubItems[1].BackColor = Color.Green; else if (radioButton2.Checked) a.SubItems[1].BackColor = Color.Orange; else if (radioButton3.Checked) a.SubItems[1].BackColor = Color.Red; else if (radioButton4.Checked) a.SubItems[1].BackColor = Color.White; if i execute that code, the subitem don't change the color how works??

    C# help question

  • ListView: set "BackColor" in a SubItem
    P Patricio Tapia

    I have a problem: if (radioButton1.Checked) a.SubItems[1].BackColor = Color.Green; else if (radioButton2.Checked) a.SubItems[1].BackColor = Color.Orange; else if (radioButton3.Checked) a.SubItems[1].BackColor = Color.Red; else if (radioButton4.Checked) a.SubItems[1].BackColor = Color.White;

    C# help

  • Get Thread Result (IAsyncResult)
    P Patricio Tapia

    Thanks You i'm working with basic Threads, like Thread obj = new Thread(method); but now i need to expand my brain =) reading msdn =)

    C# help question learning

  • Get Thread Result (IAsyncResult)
    P Patricio Tapia

    public bool resultado() { ... ... ... return true; } let's say that i'm created a Thread and i run the resultado method. How i can capture the result? msdn didn't help me :doh: (and, of course, stop the Thread)

    C# help question learning

  • can't reasign byte[] array :S
    P Patricio Tapia

    public ArrayList listcht = new ArrayList(); byte[] comparar = new byte[10]; //W3XVisionHack comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x20; comparar[4] = 0x56; comparar[5] = 0x69; comparar[6] = 0x73; comparar[7] = 0x69; comparar[8] = 0x6f; comparar[9] = 0x6e; listcht.Add(comparar); //W3X1vs1Hack comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x31; comparar[4] = 0x76; comparar[5] = 0x73; comparar[6] = 0x31; comparar[7] = 0x48; comparar[8] = 0x61; comparar[9] = 0x63; listcht.Add(comparar); //W3XCustomKick comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x43; comparar[4] = 0x75; comparar[5] = 0x73; comparar[6] = 0x74; comparar[7] = 0x6f; comparar[8] = 0x6d; comparar[9] = 0x4b; listcht.Add(comparar); } The problem here is the comparar[] array byte can't assign the new values why? they maintaine the old values. well, the sort soluction is redeclare the array

    C# data-structures help question

  • Get Process UserName
    P Patricio Tapia

    i know that but... how do you get the UserName?? http://xs220.xs.to/xs220/07415/ersdf1.JPG

    C# question

  • Get Process UserName
    P Patricio Tapia

    How i can get an UserName from a Process? (like TaskBar)

    C# question

  • Access to Object (TextBox or ListBox) from a Thread
    P Patricio Tapia

    Y readed and works fine my C# Code: public delegate void updatevalores(string dato); private void actualizarv(string datos) { if (this.InvokeRequired) { this.Invoke(new updatevalores(actualizarv),new object[]{dato}); return; } listBox1.Items.Add(dato.ToString()); } Thanks for all :rolleyes:

    C# help tutorial question

  • Access to Object (TextBox or ListBox) from a Thread
    P Patricio Tapia

    need some tutorial or example please (to understand)

    C# help tutorial question

  • Access to Object (TextBox or ListBox) from a Thread
    P Patricio Tapia

    Example: .... Thread a = new Thread(method1); a.Start(); .... .... void method1() { textBox1.Text = "Hello"; } if i execute that code, they give me an InvalidOperationException error (access to textbox1 from another process) i try to call that method using an delegate, but not works another way is add this code: CheckForIllegalCrossThreadCalls = false; but i don't need to deactivated that how i can fixed?

    C# help tutorial question

  • Passing Parameter Method into a Thread, Help!
    P Patricio Tapia

    Yep Works Fine: procesos proces = new procesos(); ThreadStart inipro = delegate { proces.iniciar(new updatevalores(actualizarv)); }; new Thread(inipro).Start(); Ok, so much battle with Thread and asyncronic querys... time to rest :zzz: thanks for all :D

    C# help question

  • Passing Parameter Method into a Thread, Help!
    P Patricio Tapia

    damn i forget to read: This is simple, but only accepts a single parameter and isn't type-safe (just like the options when using thread pool threads) :->

    C# help question

  • Passing Parameter Method into a Thread, Help!
    P Patricio Tapia

    public delegate void updatevalores(int total); public partial class FormConexiones : Form { private int procesosactuales = 0; public FormConexiones() { InitializeComponent(); } private void FormConexiones_Load(object sender, EventArgs e) { procesos proces = new procesos(); Thread pid = new Thread(new ParameterizedThreadStart(proces.iniciar)); pid.Start(new updatevalores(actualizarv)); } public void actualizarv(int total) { procesosactuales = total; } } Give me an error with ParameterizedThreadStart(proces.iniciar) The error is: none overload correspond 'iniciar' match with 'System.Threading.ParameterizedThreadStart' delegate what the :mad:

    C# help question

  • Passing Parameter Method into a Thread, Help!
    P Patricio Tapia

    public delegate void updatevalores(int total); public partial class FormConexiones : Form { private int procesosactuales = 0; public FormConexiones() { InitializeComponent(); } private void FormConexiones_Load(object sender, EventArgs e) { procesos proces = new procesos(); Thread pid = new Thread(new ThreadStart(proces.iniciar(new updatevalores(actualizarv)))); pid.Start(); } public void actualizarv(int total) { procesosactuales = total; } } Another Class: class procesos { { struct sproceso { public int id; public string NombreProceso; public string DirProceso; public string FileProceso; public DateTime tiempoinicio; } ArrayList listaprocesos = new ArrayList(); bool existeproces = false; bool coincide = false; Timer nuevotiempo = new Timer(); public void iniciar(updatevalores procesoact) { nuevotiempo.Elapsed += new ElapsedEventHandler(TiempoEjecutar); nuevotiempo.Interval = 5000; nuevotiempo.Enabled = true; } } The Line Thread pid = new Thread(new ThreadStart(proces.iniciar(new updatevalores(actualizarv)))); has give me an error. How i can pass values to proces.iniciar method?????????? Thanks

    C# help question

  • apply foreach in a byte[] ArrayList
    P Patricio Tapia

    CHeck my last reply Works Perfect now... time to rest :zzz:

    C# tutorial question

  • apply foreach in a byte[] ArrayList
    P Patricio Tapia

    Thanks Now i'm remember that byte in ArrayList This is my code: class Program { static void Main(string[] args) { Program a = new Program(); byte[] actArray1 = new byte[5]; byte[] actArray2 = new byte[5]; byte[] cant = new byte[5]; ArrayList actList = new ArrayList(); actArray1[0] = 0x6f; actArray1[1] = 0x6f; actArray1[2] = 0x5f; actArray1[3] = 0x6f; actArray1[4] = 0x1f; actArray2[0] = 0x6a; actArray2[1] = 0x6f; actArray2[2] = 0x6f; actArray2[3] = 0x6a; actArray2[4] = 0x4f; cant[0] = 0x6a; cant[1] = 0x6f; cant[2] = 0x6f; cant[3] = 0x6a; cant[4] = 0x4f; actList.Add(actArray1); actList.Add(actArray2); foreach (byte[] actArray in actList) { if (a.AreEqual(actArray,cant)) Console.WriteLine("same byte array"); } Console.ReadLine(); } private bool AreEqual(byte[] a, byte[] b) { if (a.Length != b.Length) return false; for (int i = 0; i < a.Length; i++) if (a[i] != b[i]) return false; return true; } }

    C# tutorial question

  • apply foreach in a byte[] ArrayList
    P Patricio Tapia

    Hi. an example: byte[] fileconte = new byte[6]; (code and code....) ArrayList list = new ArrayList(); list.Add(fileconte); How i can use a foreach to get list objets into a byte[]?? like: foreach (byte[] cont in list) { }

    C# tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups