Şöyle yaparız
HANDLE event = CreateEvent(NULL,TRUE,FALSE,NULL);WaitForSingleObject(event,1);
HANDLE event = CreateEvent(NULL,TRUE,FALSE,NULL);WaitForSingleObject(event,1);
netstat -ant -p tcp | findstr LISTENING
TCP 127.0.0.1:8081 0.0.0.0:0 LISTENING InHostTCP 127.0.0.1:9092 0.0.0.0:0 LISTENING InHost
class test {
[int]$i1 = 42
}
$test = [test]::new()
Write-Host $test.i1
$test.i1 = $null
Write-Host $test.i1
Çıktı olarak şunu alırız. Yani alana null değeri verilemiyor.42
0Powershell CMD ActionGet-ChildItem dir Read ContentsRename-Item ren Rename FileGet-Help /? See HelpRemove-Item del Delete FilesCopy-Item copy Copy FilesNew-Item md Create Directory (and files for PS)
$DestDIR = 'C:\Destination'
$OrigDIR = 'C:\Origin'
Get-ChildItem $OrigDir | ForEach-Object {
$OrigName = $_.Name
$OrigPath = $_.FullName
Get-ChildItem $DestDIR -Recurse | Where-Object {$_.Name -eq $OrigName} | ForEach-Object {
$DestPath = $_.FullName
Copy-Item $OrigPath $DestPath -Force
}
}CMD Example:dir c:\exampledirectoryPowershell Example:get-childitem -path c:\exampledirectory
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR heading[] = _T("CD ROM READER");
TCHAR CSCI_No_Inst[] = _T("Please enter the CSCI No below:");
TCHAR CSCI_NO[60];
switch (message)
{
case WM_CREATE:
{
TextBox = CreateWindow(TEXT("EDIT"), TEXT(""),
WS_VISIBLE | WS_CHILD | WS_BORDER,
150, 140, 250, 25,
hWnd, NULL, NULL, NULL);
HWND hwndButton_Enter = CreateWindow(
L"BUTTON", L"ENTER",
WS_VISIBLE | WS_CHILD | WS_BORDER, //Styles
405, 140, 70, 25,
hWnd, (HMENU)ENTER_BUTTON, NULL, NULL);
return 0;
}
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case ENTER_BUTTON:
int gwtstat = 0;
TCHAR title[] = _T("CSCI_NO");
gwtstat = GetWindowText(TextBox, &CSCI_NO[0], 60);
TCHAR buff[100] = L"";
TCHAR name[] = _T("CSCI_NO");
wsprintf(buff, L"The CSCI No you entered is: %s", CSCI_NO);
MessageBox(hWnd, buff, title, MB_OK);
break;
}
return 0;
}
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW + 1));
EndPaint(hwnd, &ps);
}
return 0;
}
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}wmic CPUBazı alanları görmek istersek şöyle yaparız.wmic CPU get Name,NumberOfCores,NumberOfLogicalProcessorsÇıktı olarak şunu alırız.Name NumberOfCores NumberOfLogicalProcessors
Intel(R) Core(TM) i7-xxxx CPU @ x.xxGHz 8 16wmic path Win32_DesktopMonitor get /format:listThe hosts file in windows is located at C:\Windows\System32\Drivers\etc\hosts.