代码 百分号2B 是什么意思?

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/fragrant_no1/article/details/83788024

最近在代码中遇见%2B 不清楚什么意思,这里记录一下:

 /**
     * BASE64编码
     * 可能会有不支持的编码异常
     * 默认getBytes()得到的是ASCII编码
     */
    public static String encryptBASE64(String key,String coding) throws UnsupportedEncodingException {
        byte[] bt = key.getBytes(coding);
        //处理+问题,防止浏览器忽略掉,HTML的+号%2B
        return encoder.encodeToString(bt).replaceAll("\\+","%2B");
    }

解释:
html中是+号的意思,通过 GET方式传值的时候,+号会被浏览器处理为空。

展开阅读全文

这段代码是什么意思

05-19

RetrieveCriteria rc = new RetrieveCriteria(typeof(UsersEntity));rnCondition c = rc.GetNewCondition();rnc.AddEqualTo(UsersEntity.__USERNAME, UserName);rnrnrnusing System;rnrnnamespace PersistenceLayerrnrn // 摘要:rn // 该类定义用以限定对象范围的选择条件。用户不能直接生成他的实例。 如要得到Conditon,需要通过RetrieveCriteria、DeleteCriteria的GetNewConditon()创建。rn // Condition内部是"AND"关系、Condition与Condition之间是"OR"的关系,如: RetrieveCriteria rc=newrn // RetrieveCrititeria(typeof(aEntity)); Condition c1=rc.GetNewCondition(); c1.AddEqualTo(aEntity.Name,"听棠");rn // c1.AddEqualTo(aEntity.Age,"27"); Condtion c2=rc.GetNewCondition(); c2.AddEqualTo(aEntity.City,"苏州");rn // 则最终生成的查询是:where (Name="听棠" and Age=27) or (City="苏州") 若为了生成"(a or b) andrn // c"这种形式,则请参考GetOrGroup()方法rn public class Conditionrn rn // 摘要:rn // “=”比较指定值与指定属性rn //rn // 参数:rn // attributeName:rn // 比较的属性rn //rn // attributeValue:rn // 指定值rn public void AddEqualTo(string attributeName, object attributeValue);rn //rn // 摘要:rn // "="比较两个字段是否相等rn //rn // 参数:rn // attributeName:rn // 第一个字段名rn //rn // attributeName2:rn // 第二个字段名rn public void AddEqualToField(string attributeName, string attributeName2);rn //rn // 摘要:rn // “>”比较指定值与指定属性rn //rn // 参数:rn // attributeName:rn // 比较的属性rn //rn // attributeValue:rn // 指定值rn public void AddGreaterThan(string attributeName, object attributeValue);rn //rn // 摘要:rn // ">"比较第一个字段是否大于第二个字段rn //rn // 参数:rn // attributeName:rn // 第一个字段名称rn //rn // attributeName2:rn // 第二个字段名称rn public void AddGreaterThanField(string attributeName, string attributeName2);rn //rn // 摘要:rn // “>=”比较指定值与指定属性rn //rn // 参数:rn // attributeName:rn // 比较的属性rn //rn // attributeValue:rn // 指定值rn public void AddGreaterThanOrEqualTo(string attributeName, object attributeValue);rn //rn // 摘要:rn // ">="比较第一个字段是否大于等于第二个字段rn //rn // 参数:rn // attributeName:rn // 第一个字段名称rn //rn // attributeName2:rn // 第二个字段名称rn public void AddGreaterThanOrEqualToField(string attributeName, string attributeName2);rn //rn // 摘要:rn // 与给定的列表list里的值匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // list:rn // 值列表rn public void AddIn(string attributeName, object[] list);rn //rn // 摘要:rn // “小于”比较指定值与指定属性rn //rn // 参数:rn // attributeName:rn // 比较的属性rn //rn // attributeValue:rn // 指定值rn public void AddLessThan(string attributeName, object attributeValue);rn //rn // 摘要:rn // "小于"比较第一个字段是否小于第二个字段rn //rn // 参数:rn // attributeName:rn // 第一个字段名称rn //rn // attributeName2:rn // 第二个字段名称rn public void AddLessThanField(string attributeName, string attributeName2);rn //rn // 摘要:rn // “ 小于等于 ”"比较指定值与指定属性rn //rn // 参数:rn // attributeName:rn // 比较的属性rn //rn // attributeValue:rn // 指定值rn public void AddLessThanOrEqualTo(string attributeName, object attributeValue);rn //rn // 摘要:rn // "小于等于"比较第一个字段是否小于等于第二个字段rn //rn // 参数:rn // attributeName:rn // 第一个字段rn //rn // attributeName2:rn // 第二个字段rn public void AddLessThanOrEqualToField(string attributeName, string attributeName2);rn //rn // 摘要:rn // 指定子字符串与指定属匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // attributeValue:rn // 指定字符串rn public void AddMatch(string attributeName, string attributeValue);rn //rn // 摘要:rn // 前缀匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // attributeValue:rn // 匹配值rn public void AddMatchPrefix(string attributeName, string attributeValue);rn //rn // 摘要:rn // 后缀匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // attributeValue:rn // 匹配值rn public void AddMatchSuffix(string attributeName, string attributeValue);rn //rn // 摘要:rn // “不等于”"比较指定值与指定属性rn //rn // 参数:rn // attributeName:rn // 比较的属性rn //rn // attributeValue:rn // 指定值rn public void AddNotEqualTo(string attributeName, object attributeValue);rn //rn // 摘要:rn // "不相等"比较两个字段是否不相等rn //rn // 参数:rn // attributeName:rn // 第一个字段名称rn //rn // attributeName2:rn // 第二个字段名称rn public void AddNotEqualToField(string attributeName, string attributeName2);rn //rn // 摘要:rn // 与给定的列表list里的值不匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // list:rn // 值列表rn public void AddNotIn(string attributeName, object[] list);rn //rn // 摘要:rn // 指定子字符串与指定属不匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // attributeValue:rn // 指定字符串rn public void AddNotMatch(string attributeName, string attributeValue);rn //rn // 摘要:rn // 前缀不匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // attributeValue:rn // 匹配值rn public void AddNotMatchPrefix(string attributeName, string attributeValue);rn //rn // 摘要:rn // 后缀不匹配rn //rn // 参数:rn // attributeName:rn // 属性rn //rn // attributeValue:rn // 匹配值rn public void AddNotMatchSuffix(string attributeName, string attributeValue);rn //rn // 摘要:rn // 清楚所有条件rn public void Clear();rn //rn // 摘要:rn // 创建一个OrGroup对象rn public OrGroup GetNewOrGroup();rn rnrnrnrn我在做的时候 EntityObject users = rc.AsEntity();报错 里面的字段不存在 之前我把里面有的字段都删了 添加了一些新的字段。rn 论坛

下面的代码是什么意思?

06-11

unit UnitClient;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,rn ScktComp, StdCtrls, Buttons, ExtCtrls;rnConstrnMP_QUERY ='11111';rnMP_REFUSE ='22222';rnMP_ACCEPT ='33333';rnMP_NEXTWILLBEDATA='44444';rnMP_DATA ='55555';rnMP_ABORT ='66666';rnMP_OVER ='77777';rnMP_CHAT ='88888';rnMP_END='99999';rnMP_FILEPROPERTY='00000';rniBYTEPERSEND=1024;rnrnprocedure TForm1.csRead(Sender: TObject; Socket: TCustomWinSocket);rnvarrn sRecv:string;rn bufSend:pointer;rn iLength:Integer;rnbeginrn sRecv:=Socket.ReceiveText;rn sRecv:=copy(sRecv,1,5);rn if sRecv=MP_REFUSE then rn memo1.Lines.Add('文件传输被拒绝!')rn else if sRecv=MP_ACCEPT then rn beginrn fsSend:=TFileStream.Create(OpenDialog1.FileName,fmOpenRead);rn bStart:=False;rn memo1.Lines.Add('开始发送!');rn TickCount:=GetTickCount;rn //iBYTEPERSEND是个常量,每次发送包的大小。rn Socket.SendText(MP_FILEPROPERTY+inttostr(Trunc(fsSend.Size/iBYTEPERSEND)+1));rn //创建文件流并发送文件长度。 rn end else if sRecv=MP_NEXTWILLBEDATA then rn beginrn Socket.SendText(MP_NEXTWILLBEDATA);rn //通知接收端。继续传送数据。rn end else if sRecv=MP_DATA then rn beginrn //发送数据。rn if not bStart thenrn beginrn memo1.Lines.Add('发送数据...!');rn bStart:=True;rn end;rn if fssend.Position< fsSend.Size-1 thenrn beginrn iLength:=fsSend.Size-1-fsSend.Position;rn if iLength>iBYTEPERSEND thenrn iLength:=iBYTEPERSEND;rn GetMem(bufSend,iLength+1);rn tryrn fsSend.Read(bufSend^,iLength);rn Socket.SendBuf(bufSend^,iLength);rn finallyrn FreeMem(bufSend,iLength+1);rn end;of tryrn end else//没有数据需要发送了。rn beginrn Socket.SendText(MP_ENDrn memo1.Lines.Add('结束!'+IntToStr(GetTickCount-TickCount));rn fsSend.Free; rn end;rn end else if sRecv=MP_ABORT then rn beginrn memo1.Lines.Add('中止!');rn //被取消了:(rn fsSend.Free;rn end;rnend;rnrn其中MP_QUERY ='11111';MP_REFUSE ='22222';MP_ACCEPT ='33333';rnMP_NEXTWILLBEDATA='44444';MP_DATA ='55555';MP_ABORT ='66666';rnMP_OVER ='77777';MP_CHAT ='88888';MP_END='99999';rnMP_FILEPROPERTY='00000'有什么作用?还有那边的那些if语句/rn 论坛

这些代码是什么意思

01-17

这些代码是什么意思rnrn J CreateThread 4GetPrivateProfileIntA GetCurrentThreadId GetCurrentThread lstrcmpiA ?lstrcmpA ?GlobalDeleteAtom ?GlobalAlloc ?GlobalLock $GetModuleFileNameA  CloseHandle ?WaitForSingleObject eSetEvent ?SuspendThread 1 CreateEventA lstrlenA ?InterlockedIncrement ?InterlockedDecrement ?WideCharToMultiByte ?MultiByteToWideChar ?SetThreadPriority iGetThreadPriority ,ResumeThread >GetProcAddress &GetModuleHandleA lstrcpyA ?GlobalFindAtomA GlobalAddAtomA ?GlobalGetAtomNameA ZGetLastError ?lstrcatA tGetVersion FreeResource ?LockResource ?LoadResource FindResourceA FreeLibrary ?LoadLibraryA ?LocalFree ?LocalAlloc ?InitializeCriticalSection ?TlsAlloc U DeleteCriticalSection ?GlobalFree ?GlobalUnlock ?GlobalHandle ?TlsFree ?LeaveCriticalSection ?GlobalReAlloc f EnterCriticalSection ?TlsSetValue ?LocalReAlloc ?TlsGetValue dSetErrorMode lstrcpynA ?MulDiv ?GlobalFlags :GetPrivateProfileStringA ?WritePrivateProfileStringA GetCurrentDirectoryA qSetLastError EGetProcessVersion ?IsBadStringPtrW ?IsBadStringPtrA ?IsBadWritePtr ?IsBadReadPtr FileTimeToSystemTime FileTimeToLocalFileTime ?VirtualProtect GGetProfileIntA GetCPInfo 1GetOEMCP c DuplicateHandle GetCurrentProcess 4 CreateFileA ReadFile ?WriteFile jSetFilePointer FlushFileBuffers ?LockFile ?UnlockFile aSetEndOfFile ?MoveFileA W DeleteFileA FindClose FindFirstFileA wGetVolumeInformationA GetFullPathNameA TGetStringTypeExA hGetThreadLocale NGetShortPathNameA rnGetFileAttributesA cGetTempFileNameA lSetFileTime GetFileTime GetDiskFreeSpaceA ?SizeofResource FormatMessageA FindResourceExA GetFileSize ?LocalFileTimeToFileTime ?SystemTimeToFileTime hSetFileAttributesA /RtlUnwind GetCommandLineA ExitProcess ?TerminateProcess ?HeapValidate ~ ExitThread RaiseException Q DebugBreak RGetStdHandle ?OutputDebugStringA GetACP pGetTimeZoneInformation ]GetSystemTime GetLocalTime mSetHandleCount GetFileType PGetStartupInfoA FreeEnvironmentStringsA FreeEnvironmentStringsW GetEnvironmentStrings GetEnvironmentStringsW GetEnvironmentVariableA uGetVersionExA ?HeapDestroy ?HeapCreate ?HeapFree ?VirtualFree FatalAppExitA ?HeapAlloc ?HeapReAlloc ?VirtualAlloc ?UnhandledExceptionFilter ?LCMapStringA ?LCMapStringW ! CompareStringA " CompareStringW ?SetUnhandledExceptionFilter ASetConsoleCtrlHandler SGetStringTypeA VGetStringTypeW ?Sleep ?IsBadCodePtr ?IsValidLocale ?IsValidCodePage GetLocaleInfoA w EnumSystemLocalesA qGetUserDefaultLCID |SetStdHandle bSetEnvironmentVariableA GetLocaleInfoW KERNEL32.dll ?PostQuitMessage SendMessageA ^GetWindowTextA  CallNextHookEx EnumWindows ?IsWindow DispatchMessageA ?TranslateMessage *GetMessageA Y CreateWindowExA ?RegisterClassExA ?LoadCursorA ?LoadIconA ?LoadStringA DefWindowProcA &SetCursor EnableWindow ?MessageBoxA ?IsWindowEnabled GetLastActivePopup 5GetParent VGetWindowLongA bSetWindowsHookExA GetCursorPos ?PeekMessageA ?ValidateRect GetKeyState GetFocus 9SetMenuItemBitmaps ?LoadBitmapA GetMenuCheckMarkDimensions ?PostMessageA sTabbedTextOutA + CharToOemA ?OemToCharA GetMenu 5SetMenu DrawMenuBar EGetSystemMenu gHiliteMenuItem ?IsIconic ?IsZoomed ArrangeIconicWindows \SetWindowRgn ]GetWindowRgn  BringWindowToTop \GetWindowRect GetClientRect ?MapWindowPoints : ClientToScreen rnScreenToClient BeginPaint EndPaint GetDC TGetWindowDC ReleaseDC ?UpdateWindow MGetUpdateRect NGetUpdateRgn zInvalidateRect InvalidateRgn ?ValidateRgn ?IsWindowVisible gShowOwnedPopups GetDCEx ?LockWindowUpdate ?RedrawWindow EnableScrollBar RSetTimer ?KillTimer GetActiveWindow SetActiveWindow GetCapture SetCapture  GetDesktopWindow DlgDirListA DlgDirListComboBoxA DlgDirSelectExA DlgDirSelectComboBoxExA 2GetNextDlgGroupItem 3GetNextDlgTabItem hShowScrollBar 7 ChildWindowFromPoint 8 ChildWindowFromPointEx FindWindowA RGetWindow LGetTopWindow ?IsChild >SetParent ?WindowFromPoint FlashWindow Z ChangeClipboardChain $SetClipboardViewer ?OpenClipboard 4GetOpenClipboardWindow GetClipboardOwner GetClipboardViewer H CreateCaret GetCaretPos SetCaretPos fHideCaret eShowCaret 0SetForegroundWindow GetForegroundWindow ZSendNotifyMessageA WSetWindowContextHelpId SGetWindowContextHelpId ?MapDialogRect ?GetScrollPos GSetScrollPos @GetScrollRange HSetScrollRange ?PostThreadMessageA > CloseWindow ?OpenIcon FGetSystemMetrics [GetWindowPlacement qSystemParametersInfoA yIntersectRect ?OffsetRect RegisterWindowMessageA [SetWindowPos XSetWindowLongA ,GetMessagePos -GetMessageTime RemovePropA  CallWindowProcA :GetPropA ?UnhookWindowsHookEx BSetPropA GetClassLongA GetDlgCtrlID GetClassNameA DestroyWindow _GetWindowTextLengthA GetDlgItem ZSetWindowPlacement |TrackPopupMenu ?RegisterClassA GetClassInfoA ?wsprintfA ?WinHelpA FSetScrollInfo >GetScrollInfo rnScrollWindow EndDeferWindowPos D CopyRect BeginDeferWindowPos DeferWindowPos EqualRect  AdjustWindowRectEx /SetFocus CGetSysColor SendDlgItemMessageA ?IsRectEmpty ?PtInRect DSetRect ESetRectEmpty qInflateRect ?UnionRect mSubtractRect DGetSysColorBrush ?WindowFromDC ExcludeUpdateRgn FillRect FrameRect |InvertRect DrawIcon DrawStateA DrawEdge DrawFrameControl DrawFocusRect DrawTextA GGetTabbedTextExtentA dGrayStringA ScrollDC W CreateMenu X CreatePopupMenu ?IsMenu DeleteMenu  AppendMenuA 4 CheckMenuItem EnableMenuItem 7SetMenuDefaultItem GetMenuDefaultItem "GetMenuItemCount #GetMenuItemID 'GetMenuState (GetMenuStringA $GetMenuItemInfoA BGetSubMenu tInsertMenuA ?ModifyMenuA RemoveMenu ?LoadMenuA ?LoadMenuIndirectA 6SetMenuContextHelpId GetMenuContextHelpId 5 CheckMenuRadioItem ?UnregisterClassA ^SetWindowTextA ?LoadAcceleratorsA DestroyMenu 3 CheckDlgButton 6 CheckRadioButton GetDlgItemInt GetDlgItemTextA +SetDlgItemInt ,SetDlgItemTextA ?IsDlgButtonChecked ScrollWindowEx ?IsDialogMessageA ?MoveWindow jShowWindow TranslateAcceleratorA ReleaseCapture ReuseDDElParam ?UnpackDDElParam GetClipboardFormatNameA L CreateDialogIndirectParamA EndDialog GetAsyncKeyState (SetCursorPos DestroyCursor / CharUpperA DestroyIcon GetDialogBaseUnits USER32.dll $ CreateBitmap @ CreateMetaFileA  CloseMetaFile 4 CreateEnhMetaFileA  CloseEnhMetaFile ExtTextOutA !GetDCOrgEx ZGetClipBox ?SetTextColor ?SetBkColor OGetObjectA _GetStockObject UnrealizeObject PGetObjectType D CreatePen E CreatePenIndirect ExtCreatePen M CreateSolidBrush = CreateHatchBrush & CreateBrushIndirect C CreatePatternBrush . CreateDIBPatternBrushPt 7 CreateFontIndirectA 6 CreateFontA % CreateBitmapIndirect ?SetBitmapBits GetBitmapBits ?SetBitmapDimensionEx GetBitmapDimensionEx ) CreateCompatibleBitmap 1 CreateDiscardableBitmap B CreatePalette < CreateHalftonePalette TGetPaletteEntries ?SetPaletteEntries AnimatePalette NGetNearestPaletteIndex ?ResizePalette H CreateRectRgn I CreateRectRgnIndirect 2 CreateEllipticRgn 3 CreateEllipticRgnIndirect G CreatePolygonRgn F CreatePolyPolygonRgn J CreateRoundRectRgn ?PathToRegion ExtCreateRegion \GetRegionData ?SetRectRgn  CombineRgn EqualRgn ?OffsetRgn ^GetRgnBox ?PtInRegion ?RectInRegion + CreateDCA > CreateICA * CreateCompatibleDC %GetDeviceCaps rnGetBrushOrgEx ?SetBrushOrgEx EnumObjects ?SelectObject MGetNearestColor ?RealizePalette rnUpdateColors GetBkColor GetBkMode XGetPolyFillMode YGetROP2 `GetStretchBltMode iGetTextColor GGetMapMode yGetViewportOrgEx xGetViewportExtEx |GetWindowOrgEx GetWindowExtEx N DPtoLP ?LPtoDP FillRgn FrameRgn ?InvertRgn ?PaintRgn ?PtVisible ?RectVisible GetCurrentPositionEx rn Arc ?Polyline  Chord X Ellipse ?Pie ?Polygon ?PolyPolygon ?Rectangle ?RoundRect ?PatBlt  BitBlt StretchBlt VGetPixel ?SetPixel FloodFill ExtFloodFill TextOutA nGetTextExtentPoint32A eGetTextAlign sGetTextFaceA uGetTextMetricsA fGetTextCharacterExtra GetCharWidthA GetAspectRatioFilterEx Escape ?SetBoundsRect GetBoundsRect ?ResetDCA RGetOutlineTextMetricsA GetCharABCWidthsA 3GetFontData BGetKerningPairsA :GetGlyphOutlineA ?StartDocA StartPage \ EndPage ?SetAbortProc AbortDoc Z EndDoc ?MaskBlt ?PlgBlt ?SetPixelV  AngleArc GetArcDirection ?PolyPolyline GetColorAdjustment GetCurrentObject ?PolyBezier W DrawEscape ExtEscape GetCharABCWidthsFloatA GetCharWidthFloatA  AbortPath  BeginPath Z CloseFigure ] EndPath FillPath FlattenPath LGetMiterLimit UGetPath ?SetMiterLimit StrokeAndFillPath StrokePath rnWidenPath GdiComment ?PlayEnhMetaFile S DeleteObject P DeleteDC ?SaveDC ?RestoreDC ?SelectPalette ?SetBkMode ?SetPolyFillMode ?SetROP2 ?SetStretchBltMode ?SetMapMode ?SetViewportOrgEx ?OffsetViewportOrgEx ?SetViewportExtEx ?ScaleViewportExtEx ?SetWindowOrgEx ?OffsetWindowOrgEx 论坛

没有更多推荐了,返回首页