确定已经有人问过并已经回答了,但是我找不到合适的教程.我希望将文本显示给其他地方的用户,以防止我的代码变得太大而且不可读.我的网站不会国际化.我只想拥有一些带键值结构的文件并从中获取文本.我希望将文本保存在文件中,而不是像某些教程所建议的那样保存在数据库中.我找到了一个可行的解决方案,但我不确定这是否是一个好方法.我正在考虑使用parse_ini_file并将我的文本保存在.ini文件中.这种方法有问题吗?你能提出更好的建议吗?
我有函数返回一个字符的索引GetCharFromPos(Pt:TPoint):整数;
现在我想得到那个位置的特征.比如GetCharByIndex(Index:Integer):Char;
我想发送一个自定义对象system.servicemodel.Channels.Message
.喜欢
public class person
{
string Id;
string Name;
}
MessageVersion mv = MessageVersion.Create(Soap12);
String action = "Msg";
Message msg = Message.Create(mv, action, new person());
serviceref.ProcessMsg(msg) // this is my service reference in client
//when i tried to access this in Service like
person p = msg.GetBody<person>()
//I am getting an serialization exception
//I have the Person class on both client and service side
Run Code Online (Sandbox Code Playgroud)
有人可以帮我弄清楚我的错误吗?
我查看了一些关于类似问题的其他问题,并且我发现我需要使用该onProgressUpdate
方法来更改消息ProgressDialog
.
例如,我有这样的代码在AsyncTask
s 中运行doInBackGround
(这只是一个非常小的样本):
byte[] data = getBytesFromFile(image);
String lineEnd = "\r\n";
String twoHyphens = "--";
String boundary = "*****";
pictures.dia.setProgress(30);
pictures.dia.setMessage("Data beginning upload sequence...");
URL connectURL = new URL(this.base_url);
HttpURLConnection conn = (HttpURLConnection) connectURL.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestMethod("POST");
conn.setRequestProperty("Connection", "Keep-Alive");
conn.setRequestProperty("Content-Type", "multipart/form-data, boundary=" + boundary);
DataOutputStream dos = new DataOutputStream(conn.getOutputStream());
pictures.dia.setProgress(40);
pictures.dia.setMessage("Output Stream prepared...");
Run Code Online (Sandbox Code Playgroud)
当我最初这样运行时,我得到一个漏洞窗口错误,说我不能改变dia
之外的消息AsyncTask
.
所以我的问题是,我如何使用onProgressUpdate
设置进度dia
何时dia
达到一定数量的信息?(也就是说,当dia
进度= 30时,让它说"数据开始上传序列...")
onProgressUpdate
显然必须始终检查dia …
我用C#编写了一个简单的程序,其中
{
MessageBox.Show("Enter the Correct Values. ", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
return;
}
Run Code Online (Sandbox Code Playgroud)
一些文本框内容使用StreamWriter写入文本文件。在这两种情况下,除了正确的内容之外,我还获得了前缀:System.Windows.Forms.TextBox,Text:
使用StreamReader读取文本文件的内容时,得到类似的前缀(后缀为\ r \ n)。
如何避免这种情况?
从我的Delphi程序中,我希望能够从OutLook中的某个文件夹中检索所有邮件,并将它们保存为文件.我需要检索发件人,主题,日期和消息iD,以便将信息保存在表格中(如果可能的话,更多部分)我希望将每封邮件保存在一个文件中,以便我以后可以访问它们.
有没有办法设置php die();
消息的输出样式?
我想在错误消息周围添加一些HTML和CSS,以便我可以在高效的环境中使用它.
我正在尝试制作Erlang程序,用流程找到素数(无效,我知道,但是,嘿,这只是为了好玩:)) - 有点像numbersimulation.com.
在每个"tick"上,服务器产生增加其计数器的新进程("数字").如果counter ==那个数字,这是一个因素,所以我们让服务器知道.如果服务器没有收到任何消息,那么它是一个素数.
在小数字(素数高达N,server(50,L)
线条)它没关系,但在更大的数字上它崩溃:
Error in process <0.46.0> with exit value: {badarg,[{primes,number,2,[{file,"primes.erl"},{line,31}]}]}
第31行就是那一行server ! hit
- 但我不明白为什么会失败.也许失败的那条线是后来的,number(N,1)
?但为什么会失败呢?
代码:
-module(primes).
-compile(export_all).
main() ->
pg:create(numbers),
Server_PID = spawn(?MODULE,server,[]),
register(server,Server_PID),
ok.
server() -> server(2,[]).
server(50,L) -> io:format("Primes: ~p~n",[L]);
server(N,L) ->
Num_PID = spawn(?MODULE,number,[N]),
pg:join(numbers,Num_PID),
pg:send(numbers,tick),
receive
hit ->
flush(),
server(N+1,L)
after 100 ->
server(N+1,[N|L])
end.
number(N) -> receive {pg_message,_,_,tick} -> number(N,1) end.
number(N,I) ->
receive
{pg_message,_,_,tick} ->
if
N =:= I …
Run Code Online (Sandbox Code Playgroud) 标准的管理工具栏按钮可以为您提供消息.例如:"真正删除"消息或某事......
JToolBarHelper::deleteList('Do you wanna really delete?', 'controller.delete');
Run Code Online (Sandbox Code Playgroud)
这也适用于自定义按钮吗?在文档中没有参数.http://docs.joomla.org/JToolBarHelper/custom
Joomla有另一种解决方案吗?向用户显示消息并在确认后执行我的代码!那可能吗?
抱歉我的英文不好:)谢谢!
我不知道如何显示成功/错误消息。主要问题是在哪里放置代码。在这里,我要插入我的代码。请帮助我完成它。我是Codeigniter的新手,这里的一切都井井有条。在此之前,在核心php中,我们通过header('location ...');传递错误/成功消息;但是,这是完全不同的。
查看(index.php)
<?php echo form_open_multipart('welcome/MemberFileUpload');?>
<input type="file" name="files[]" multiple> <br>
<input type='submit' value='Submit'>
</form>
Run Code Online (Sandbox Code Playgroud)
控制者
class Welcome extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('news_model');
$this->load->library('session'); // Start Session
$this->load->helper('form');
$this->load->library('form_validation');
}
public function member_CAttachments()
{
$data['results'] = $this->news_model->member_MAttachments();
$this->load->view('member/templates/header');
$this->load->view('member/index',$data);
$this->load->view('member/templates/footer');
}
function MemberFileUpload()
{
$this->form_validation->set_rules('FileTitle', 'Title', 'required');
if ($this->form_validation->run() === FALSE)
{
redirect('welcome/member_CAttachments/');
}
else
{
$FileTitle = $this->input->post('FileTitle');
$FileDesc = $this->input->post('FileDesc');
$CurrentDate=date("Y-m-d h:i:s");
$InsertedFileID=$this->news_model->UploadFileDetails($FileDesc, $CurrentDate,$FileTitle);
$UploadDirectory='assets/Upload/';
$TotalUploadedFiles=count($_FILES['files']['name']);
for($i=0;$i<$TotalUploadedFiles;$i++)
{
$UploadedFileName=$_FILES['files']['name'][$i];
$EncFileName=time().$UploadedFileName;
if(move_uploaded_file($_FILES['files']['tmp_name'][$i], $UploadDirectory.$EncFileName))
{ …
Run Code Online (Sandbox Code Playgroud)