7 Mart 2022 Pazartesi

Insert id

 For SQL Server 2005+, if there is no insert trigger, then change the insert statement (all one line, split for clarity here) to this

INSERT INTO aspnet_GameProfiles(UserId,GameId)
OUTPUT INSERTED.ID
VALUES(@UserId, @GameId)

For SQL Server 2000, or if there is an insert trigger:

INSERT INTO aspnet_GameProfiles(UserId,GameId) 
VALUES(@UserId, @GameId);
SELECT SCOPE_IDENTITY()

And then

 Int32 newId = (Int32) myCommand.ExecuteScalar();

30 Eylül 2021 Perşembe

Test Post

 ZHGY5EhCJy!2$=vx=3E=

Launchy run admin

 shell:startup ile start klasörüne erişin ve Launchy kısayolundan admin olarak çalışma özelliğini aktif ediniz.


https://www.launchy.net/ 

15 Eylül 2021 Çarşamba

27 Temmuz 2021 Salı

Launchy ile visual studio projelerini administrator olarak çalıştırmak.

 

Add an app to run automatically at startup in Windows 10

  1. Select the Start  button and scroll to find the app you want to run at startup.

  2. Right-click the app, select More, and then select Open file location. This opens the location where the shortcut to the app is saved. If there isn't an option for Open file location, it means the app can't run at startup.

  3. With the file location open, press the Windows logo key  + R, type shell:startup, then select OK. This opens the Startup folder.

  4. Copy and paste the shortcut to the app from the file location to the Startup folder.

23 Temmuz 2021 Cuma

HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure (Windows Server)

 Projemde .Net Core 2.2 kullanmıştım proje çalıştırıldığında alınan hata

HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure (Windows Server)



dotnet --list-runtimes

Komutu ile yüklü olan runtime versiyonlarını görürsünüz.


Microsoft.AspNetCore.All 2.2.8 yüklenince sorunlar çözüldü.



8 Mart 2021 Pazartesi

crt sertifikanın IIS için pfx dönüştürme işlemi

 openssl pkcs12 -export -out c.pfx -inkey private.key -in certificate.crt -certfile ca_bundle.crt

2 Aralık 2020 Çarşamba

WcfTestClient.exe

 C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE

13 Ekim 2020 Salı

5 Mart 2018 Pazartesi

Yakında

https://github.com/icflorescu/iisexpress-proxy

29 Kasım 2017 Çarşamba

Action İle Formdan Forma Veri Taşımak

   1. Adım Ben bunu bir method içinde kullandım .

Action setCustomerAction = delegate (int CustomerId)
            {
                _customerId = CustomerId;

                _controller.List(new CustomerFilterModel() { CustomerId = _customerId });
                var searchSponsor = _controller.DataSource.FirstOrDefault();


                lblCustomerTitle.Text = searchSponsor.Title;
                txtCustomerCode.Text = searchSponsor.CustomerCode;
            };

2.Adım Actionu diğer forma göndeririz.
   var customerList = new UICurrentList(_controller, setCustomerAction);
            customerList.Show();




   3.Adım Actionun içine parametreyi gönderip Invoke ettikmi 1. adımdaki kod çalışır.

_selectCustomerId.Invoke(_listController.DataSource.FirstOrDefault().CustomerId);

20 Ekim 2017 Cuma

MSSQL Limitleme

SELECT  *
FROM     sys.databases
ORDER BY name 
OFFSET  5 ROWS 
FETCH NEXT 5 ROWS ONLY 

14 Temmuz 2017 Cuma

C# Runtime Code Execution

using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.CSharp;

namespace RuntimeCoreExecution
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
            string source =
                @"
namespace RuntimeCoreExecution
{
using System;
using System.Linq;
using System.Windows.Forms;
    public partial class Form1
    {
        public void SelamSoyle()
        {
               var textBox = System.Windows.Forms.Application.OpenForms[""Form1""].Controls.Find(""textBox1"", true).FirstOrDefault() as TextBox;
               textBox.Text = ""Selam"";
        }
    }
}
            ";


            Dictionary providerOptions = new Dictionary
            {
                {"CompilerVersion", "v4.0"}
            };
            CSharpCodeProvider provider = new CSharpCodeProvider(providerOptions);

         
            var compilerParams = new CompilerParameters()
            {
                GenerateInMemory = true,
                GenerateExecutable = false,
                ReferencedAssemblies =
                {
                    "System.dll",
                    "System.Core.dll",
                    "System.Data.dll",
                    "System.Xml.dll",
                    "System.Xml.Linq.dll",
                    "System.Windows.Forms.dll",

                },
            };



            CompilerResults results = provider.CompileAssemblyFromSource(compilerParams, source);

            if (results.Errors.Count != 0)
                throw new Exception("Mission failed!");

            object o = results.CompiledAssembly.CreateInstance("RuntimeCoreExecution.Form1");
            MethodInfo mi = o.GetType().GetMethod("SelamSoyle");
            mi.Invoke(o, null);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            var textBox = Application.OpenForms["Form1"].Controls.Find("textBox1", true).FirstOrDefault() as TextBox;
            textBox.Text = "Selam";
        }
    }
}