Dart syntax - Isolates,typedefs,metadata@ Get link Facebook X Pinterest Email Other Apps - August 16, 2020 ☝called 讓實體能像方法一樣☝Isolates dart能讓每個isolates有自己的記憶體和單線,解決多項事件同時共享記憶體時容易發生錯誤的問題。☝typedefs 很像填表單一樣,有個單表名稱,內容就是自定義一個制式的程式格式。初始即對應填表單。☝metadata @程式注記。可自定義。建立dart ,後導入 import xxx.dart ,@xxx。 Get link Facebook X Pinterest Email Other Apps Comments
Go - connect remote SQL server - March 16, 2022 refer from: https://studygolang.com/articles/19117 package sqlsvr import ( "fmt" "database/sql" "strings" "wms.api/model" _ "github.com/denisenkom/go-mssqldb" _ "github.com/mattn/go-adodb" ) type Mssql struct { *sql.DB dataSource string database string windows bool sa SA } type SA struct { user string passwd string } func (m *Mssql) Open() (err error ) { var conf [] string conf = append(conf, "Provider=SQLOLEDB" ) conf = append(conf, "Data Source=" +m.dataSource) if m.windows { // Integrated Security=SSPI :以当前WINDOWS系统用户身去登录SQL SERVER服务器(需要在安装sqlserver时候设置), // 如果SQL SERVER服务器不支持这种方式登录时,就会出错。 conf = ... Read more
Dart - CRUD file in path - October 04, 2020 20201004 import 'dart:io' ; import 'package:flutter/material.dart' ; import 'package:path_provider/path_provider.dart' ; void main () async { WidgetsFlutterBinding. ensureInitialized () ; await getApplicationDocumentsDirectory().then((Directory dir) { File file = File ( ' ${dir. path } /text.txt' ) ; file.writeAsString( '123' ) ; void read() async { String contents = await file.readAsString() ; print(contents) ; } read() ; }) ; } [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: FileSystemException: Cannot open file, path = '//test.txt' (OS Error: Read-only file system, errno = 30) FileSystemException: Cannot open file OS Error: Is a directory reading-writing-files Read more
Comments
Post a Comment