Python
- 3 ответа
- 0 вопросов
3
Вклад в тег
contents := []byte("Hello World")
// write a password zip
raw := new(bytes.Buffer)
zipw := zip.NewWriter(raw)
w, err := zipw.Encrypt("hello.txt", "golang")
if err != nil {
log.Fatal(err)
}
_, err = io.Copy(w, bytes.NewReader(contents))
if err != nil {
log.Fatal(err)
}
zipw.Close()
// read the password zip
zipr, err := zip.NewReader(bytes.NewReader(raw.Bytes()), int64(raw.Len()))
if err != nil {
log.Fatal(err)
}
for _, z := range zipr.File {
z.SetPassword("golang")
rr, err := z.Open()
if err != nil {
log.Fatal(err)
}
_, err = io.Copy(os.Stdout, rr)
if err != nil {
log.Fatal(err)
}
rr.Close()
}
.to_csv('file.csv',encoding='utf-8-sig')
add_shortcode( 'current_user_link', 'wppbc_current_user_link' );
function wppbc_current_user_link( $atts, $content ) {
if ( is_user_logged_in() ) {
$id = get_current_user_id();
// make sure to change the URL to represent your setup.
if($id!=null){ return "<a href='http://website.com/user-listing-page/user/{$id}'>Your User Page</a>"; }
else{ return "<a href='http://website.com/user-listing-page/login'>Log In</a>";}
}
return ;
}
if($id!=null){ return "<a href='http://website.com/user-listing-page/user/{$id}'>Your User Page</a>"; }
else{ return "<a href='http://website.com/user-listing-page/login'>Log In</a> <a href='http://website.com/user-listing-page/signup'>Sign Up</a>";}