Last active
December 17, 2015 02:38
-
-
Save tufanbarisyildirim/5536904 to your computer and use it in GitHub Desktop.
php DOTNET sınıfına bir örnerk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Bu stringi GAC(Global Assembly Cache) 'ten oluşturmamız gerekiyor | |
* C:\Windows\assembly klasorunde sınıf bulunup Version, Culture ve PublicToken Alınmalı | |
* Bu klasörde yoksa ; dll buraya drag drop yontemiyle atılırsa register edilmiş olur | |
* | |
* @var mixed | |
*/ | |
$gac_string = 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'; | |
$class_name = 'System.Windows.Forms.Form'; | |
$form = new DOTNET($gac_string, $class_name); | |
// System.Windows.Forms.Form.Show metodunu cağırmış olduk. Windows sunucuda şuan bir form oluşmuş oldu | |
$form->Show(); | |
while(true) { | |
//bu betik sonlanırsa com object de yok olacağından açık tuttum. | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Kefukar | |
{ | |
public class Dotnet | |
{ | |
public string getName() { | |
return "Savaş DOĞAN"; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$gac_string = 'Kefukar'; | |
$class_name = 'Kefukar.Dotnet'; | |
$form = new DOTNET($gac_string, $class_name); | |
$name = $form->getName(); | |
echo $name; | |
// Savaş Doğan | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment