AD讀取的程式碼(C#)
DirectoryEntry entry = new DirectoryEntry("LDAP://GOOGLE.COM.TW:389", "userName", "password"); entry.RefreshCache();
一直出現錯誤畫面:
解決的方法如下:
- 在 Windows Server 2003 中,userName不需要加 domain。
- ladp路徑要大寫 <=== 卡了我一個多禮拜的兇手。
如果你是這樣而排除錯誤的話,留個言讓我知道一下吧!
DirectoryEntry entry = new DirectoryEntry("LDAP://GOOGLE.COM.TW:389", "userName", "password"); entry.RefreshCache();
@interface Student: NSObject { NSString *iName; NSString *iStudentID; int age; } @property(nonatomic,copy) NSString *iName; @property(nonatomic,copy) NSString *iStudentID; @property(nonatomic,assign) int age; @end
#import "student.h" @implementation student @synthesize iName,iStudentID,age; - (void) dealloc { [iName release]; [iStudentID release]; [super dealloc]; } @end
NSMutableArray *arr = [[NSMutableArray alloc] initWithCapacity : 0];//array.retainCount = 1 NSString *str1 = [[NSString alloc] initWithString : @"A"];//str1.retainCount = 1 NSString *str2 = [[NSString alloc] initWithString : @"A"];//str2.retainCount = 1 [arr addObject : str1];//str1.retainCount = 2 [arr addObject : str2];//str2.retainCount = 2 [arr removeObject : str1];//str1.retainCount = 1 [arr release];//array.retainCount = 0;str2.retainCount = 1 //系統回收 array [str1 release];//str1.retainCount = 0 [str2 release];//str2.retainCount = 0 //系統回收str1&str2
int number = 0;//取值 char[] name = ['n','a','m','e']; char *str = name;//取址
$("#file_upload").bind('change',function(){});
$("#file_upload").live('change',function(){});
$('#file_upload').replaceWith('<input id="file_upload" name="file_upload" type="file">');
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.google.android.maps.MapView android:id="@+id/mView_Main" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="你自己的key"> </com.google.android.maps.MapView> </LinearLayout>
@interface Test : NSObject { NSData *iData; } @property(nonatomic,retain) NSData *iData; @end
-(void) setIData : (NSData *) newData { if(iData != newData){ [iData release]; iData = [newData retain]; } } -(NSData *) getIData { return iData; }
![]() |
QR Code |
invalid command-line parameter: Files\android-sdk-windows\tools/emulator-arm.exe.
Hint: use '@foo' to launch a virtual device named 'foo'.
please use -help for more information
import java.util.Calendar; public class main { public static void main(String[] args) { testStringBuilder(); } public static void testStringBuilder() { StringBuilder sBuilder = new StringBuilder(); System.out.println("1. string of new StringBuilder()"); if(sBuilder == null){ System.out.println("string:[is null]"); }else{ System.out.println("result:string:[" + sBuilder + "],length:[" + sBuilder.length() + "]"); } StringBuilder sBuilder2 = new StringBuilder(""); System.out.println("2. string of new StringBuilder(\"\")"); if(sBuilder2 == null){ System.out.println("string:[is null]"); }else{ System.out.println("result:string:[" + sBuilder2 + "],length:[" + sBuilder2.length() + "]"); } StringBuilder sBuilder3 = new StringBuilder(); String nullString = null; sBuilder3.append(nullString); System.out.println("3. string of new StringBuilder() append null"); if(sBuilder3 == null){ System.out.println("string:[is null]"); }else{ System.out.println("result:string:[" + sBuilder3 + "],length:[" + sBuilder3.length() + "]"); } StringBuilder sBuilder4 = new StringBuilder(""); sBuilder4.append(nullString); System.out.println("4. string of new StringBuilder(\"\") append null"); if(sBuilder4 == null){ System.out.println("string:[is null]"); }else{ System.out.println("result:string:[" + sBuilder4 + "],length:[" + sBuilder4.length() + "]"); } }
屬性 | 說明 |
getter=method | 指定物件的get method |
setter=method | 指定物件的set method |
readonly | 指定物件為唯獨狀態 |
readwrite | 指定物件為可讀寫狀態(預設) |
assign | 物件的值根據帶入的值決定,不改變索引計數(預設) |
copy | 複製物件的設定,索引計數為1,釋放舊的物件 |
retain | 保持物件的設定,提高物件的索引計數,並釋放舊的物件 |
nonatomic | 不鎖定物件(多執行緒的時候,資源會競爭) |
public Engine onLoadEngine(); public void onLoadResources(); public void onUnloadResources(); public Scene onLoadScene(); public void onLoadComplete(); public void onGamePaused(); public void onGameResumed();
Environment.getExternalStorageState()狀態有以下幾種:
Environment.getExternalStorageDirectory().getPath()
StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath()); // 未使用(單位:bytes) long sdFreeSize = stat.getAvailableBlocks() * stat.getBlockSize(); // 總容量(包含保留空間,單位:bytes) long sdTotalSize = stat.getFreeBlocks() * stat.getBlockSize(); // 已使用(單位:bytes) long sdUsedSize = sdTotalSize - sdFreeSize ;
SELECT column FROM table ORDER BY RAND()
SELECT column FROM table ORDER BY RANDOM() LIMIT 1
SELECT TOP 1 column FROM table ORDER BY NEWID()
SELECT column, RAND() as IDX FROM table ORDER BY IDX FETCH FIRST 1 ROWS ONLY
SELECT column FROM ( SELECT column FROM table ORDER BY dbms_random.value ) WHERE rownum = 1
We are a group of interaction designers based in Amsterdam. We are UNITiD and we will keep this site as fresh and crispy as possible.