  | 
				VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.   
				 | 
			 
		 
		 
	
		| 上一篇主題 :: 下一篇主題   | 
	 
	
	
		| 發表人 | 
		內容 | 
	 
	
		Ruey
 
 
  註冊時間: 2003-03-12 文章: 1698 來自: tunglo
  第 1 樓
  | 
		
			
				 發表於: 星期日 七月 13, 2003 8:22 pm    文章主題: 內部網路廣播使用Net Send | 
				     | 
			 
			
				
  | 
			 
			
				Send a message to any WinNT+? computer that is running the Messenger service, without having to use the Command line "NET SEND" command.
 
 
PROCEDURE NetSend
 
LPARAMETERS pcUser, pcMessage
 
 
DECLARE INTEGER NetMessageBufferSend IN netapi32 ;
 
  STRING servername, STRING UserName, STRING fromname, ;
 
  STRING MessageBuf, INTEGER buflen
 
  
 
LOCAL lnLen, lcFrom, lcMsgName, lcUser, lcMsg
 
lcUser = strconv( StrConv(pcUser,1), 5)
 
lcMsg = strconv( StrConv(pcMessage,1), 5)
 
lcFrom = strconv( Strconv(Sys(0),1), 5)
 
lnLen = len(pcMessage)*2+2
 
res=NetMessageBufferSend( 0, lcUser, lcFrom, lcMsg, lnLen )
 
RETURN res
 
 
 
Return Values:
 
5 = ERROR_ACCESS_DENIED The user does not have access to the requested information. 
 
87 = ERROR_INVALID_PARAMETER The specified parameter is invalid. 
 
50 = ERROR_NOT_SUPPORTED This network request is not supported. 
 
2100+173 = NERR_NameNotFound? The user name could not be found. 
 
2100+36 = NERR_NetworkError? A general failure occurred in the network hardware. _________________ #############################
 
快樂媽咪系列幸福宅配,喝十全雞湯~原來幸福那麼簡單!!
 
 
學會VFP使用者社區的搜尋,Code才會更有趣~
 
############################# | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		215001
 
 
  註冊時間: 2003-06-11 文章: 393
 
  第 2 樓
  | 
		
			
				 發表於: 星期二 九月 26, 2006 1:06 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				請教Ruey
 
 
我於Dos下:
 
NET SEND PC2 Hello 是正常的(PC2為另一台電腦名稱)
 
 
但是於VFP下:
 
=NetSend("PC2","Hello")
 
卻都不成功,傳回值有時是123,有時傳回2273,是那邊錯了 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		goto-dream
 
 
  註冊時間: 2004-05-11 文章: 909
 
  第 3 樓
  | 
		
			
				 發表於: 星期五 九月 29, 2006 12:31 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				local ws,isok 
 
ws = createobject("WScript.Shell") 
 
isok = ws.run("ping 103.102.255.123",0,"True") 
 
if ISOK = 0 
 
messagebox("ping OK!") 
 
else 
 
messagebox("ping ERROR!") 
 
endif
 
 
我用這種模式去改,沒用到上述方法!!你可以試看看 _________________ 福隆昌淨水有限公司--淨水器的專家,淨水器,飲水機,濾心!!
 
 
想了解更多,您可上幸福雞湯組.找尋!!丁澐瑄.老師.
 
 
          愛作夢 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		215001
 
 
  註冊時間: 2003-06-11 文章: 393
 
  第 4 樓
  | 
		
			
				 發表於: 星期五 九月 29, 2006 4:20 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				謝謝 goto-dream
 
 
類似的方法我知道,只是有時間時,我都會試試看別人貼出來的程式碼
 
看看可不可以執行成功,剛好這一篇怎麼都試不出來,所以才會提問 | 
			 
		  | 
	 
	
		| 回頂端 | 
		 | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
  	 
	    
  	   | 
 	
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
  | 
   
  
		 |